diff --git a/.github/workflows/build-test-python-package-pull.yml b/.github/workflows/build-test-python-package-pull.yml index 801a2f5..b0a4f30 100644 --- a/.github/workflows/build-test-python-package-pull.yml +++ b/.github/workflows/build-test-python-package-pull.yml @@ -11,8 +11,8 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: fjwillemsen/setup-nox2@v3.0.0 + - uses: actions/checkout@v7 + - uses: fjwillemsen/setup-nox2@v4 - run: | nox -- ${{ runner.os }} - name: Report to Coveralls diff --git a/.github/workflows/build-test-python-package.yml b/.github/workflows/build-test-python-package.yml index a2951ed..07bffce 100644 --- a/.github/workflows/build-test-python-package.yml +++ b/.github/workflows/build-test-python-package.yml @@ -26,22 +26,22 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 # fetch all history to avoid detached HEAD state when pushing benchmark results - name: Download previous benchmark data - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: ./cache key: ${{ runner.os }}-benchmark - - uses: fjwillemsen/setup-nox2@v3.0.0 + - uses: fjwillemsen/setup-nox2@v4 - run: | nox -- ${{ runner.os }} - name: Store benchmark result uses: benchmark-action/github-action-benchmark@v1 with: tool: "pytest" - output-file-path: .benchmarks/benchmark_${{ runner.os }}_3.13.json + output-file-path: .benchmarks/benchmark_${{ runner.os }}_3.14.json external-data-json-path: ./cache/benchmark-data.json fail-on-alert: true # GitHub API token to make a commit comment diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index cfb7a6c..fec19bf 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -23,16 +23,16 @@ jobs: strategy: matrix: # important: if this matrix is changed, also change EXPECTED_WHEELS_COUNT in `build_and_publish_as_package` below - os: [ubuntu-22.04, ubuntu-latest, macos-latest, windows-latest] # ubuntu-22.04 is used to generate wheels for manylinux_2_35 in addition to the manylinux_2_39 of ubuntu-latest - pyversion: ["3.9", "3.10", "3.11", "3.12", "3.13"] + os: [ubuntu-latest, ubuntu-24.04-arm, ubuntu-22.04, ubuntu-22.04-arm, macos-latest, windows-latest, windows-11-arm] # ubuntu-22.04 is used to generate wheels for manylinux_2_35 in addition to the manylinux_2_39 of ubuntu-latest + pyversion: ["3.11", "3.12", "3.13", "3.14"] exclude: - os: ubuntu-latest - pyversion: "3.12" # exclude because we already use this OS and version for building the source package + pyversion: "3.14" # exclude because we already use this OS and version for building the source package steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.pyversion }} - name: Setup Poetry @@ -43,7 +43,7 @@ jobs: poetry build -f wheel ls ./dist - name: Upload the built wheel distribution - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ${{ matrix.os }}_${{ matrix.pyversion }} path: ./dist/*.whl @@ -60,20 +60,20 @@ jobs: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - name: Build the source distribution and platform-specific wheel - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v7 with: - python-version: "3.12" + python-version: "3.14" - name: Setup Poetry uses: Gr1N/setup-poetry@v9 - - name: Build for Python 3.12 on ubuntu-latest + - name: Build for Python 3.14 on ubuntu-latest run: | poetry install poetry build ls ./dist - name: Download all platform-specific wheels to the `temp_dist` folder - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: path: ./temp_dist - name: Unpack the remotely built wheels to the `dist` folder @@ -96,7 +96,7 @@ jobs: exit 1; fi - EXPECTED_WHEELS_COUNT=20 + EXPECTED_WHEELS_COUNT=28 WHEELS_COUNT=$(ls -lR ./dist/*.whl | wc -l) echo "Number of wheel distributions: $WHEELS_COUNT" if [ "$WHEELS_COUNT" -ne "$EXPECTED_WHEELS_COUNT" ]; then diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dcaf88..f134df6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,39 @@ All notable changes to this code base will be documented in this file, for every released major and minor version. For all versions, see [releases](https://github.com/python-constraint/python-constraint/releases). +### Version 2.7.0 +- Released: 2026-08-14 +- Issues / Enhancements: + - Added ARM-wheels for Ubuntu and Windows. + - Bumped version numbers of build system, e.g. Python versions and GitHub Actions. + - Cythonized with new version. + - Updated several development and documentation dependencies. + - Dropped no longer needed testing dependency. + +### Version 2.6.0 +- Released: 2026-06-29 +- Issues / Enhancements: + - Improved type specification. + - Resolved issue #108 relating to pruning (thank you @gaoflow). + - Various minor improvements. + - Updated build and documentation dependencies. + - Dropped Python 3.9 & 3.10 support. + +### Version 2.5.0 +- Released: 2026-01-08 +- Issues / Enhancements: + - Added Python 3.14 support. + - Resolved issue #103 relating to pruning. + - Various minor improvements. + +### Version 2.4.0 +- Released: 2025-07-23 +- Issues / Enhancements: + - `MinSumConstraint` is now much faster thanks to preprocessing. + - Variables values can be instantiated with any type that can be iterable, such as sets. + - Two issues (#13 and #65) relating to the examples have been resolved. + - Various minor improvements. + ### Version 2.3.0 - Released: 2025-06-17 diff --git a/README.rst b/README.rst index e0b8031..6adf220 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,6 @@ -|License| |Build Status| |Docs| |Python Versions| |Downloads| |Status| |Code Coverage| +|CondaDownloads| |Downloads| +|Python Versions| +|License| |Build Status| |Status| |Docs| |Code Coverage| .. image:: https://github.com/python-constraint/python-constraint/raw/main/docs/assets/logo/N-Queens_problem_Python.svg :align: center @@ -7,13 +9,16 @@ python-constraint ================= -| This software is now back to active development / maintainance status. -| IMPORTANT: the new version can be installed with `pip install python-constraint2`, as the original pip release will not be updated. +| ⚠️ IMPORTANT: this software must be installed with ``pip install python-constraint2``, as the original pip release will not be updated. +| A `Conda Forge `_ / `Mamba `_ version is also available: ``conda install python-constraint2``. +| + | For an overview of recent changes, visit the `Changelog `_. | The complete documentation can be found `here `_. +| | New: writing constraints in the new string format is preferable over functions and lambdas. -| These strings, even as compound statements, are automatically parsed to faster built-in constraints, are more concise, and do not require constraint solving familiarity by the user to be efficient. +| These strings, even as compound statements, are automatically parsed to faster built-in constraints, are more concise, and do not require constraint solving familiarity by the user to be efficient. | For example, :code:`problem.addConstraint(["50 <= x * y < 100"])` is parsed to :code:`[MinProdConstraint(50, ["x", "y"]), MaxProdConstraint(100, ["x", "y"])]`. | Similarly, :code:`problem.addConstraint(["x / y == z"])` is parsed to :code:`[ExactProdConstraint("x", ["z", "y"])]`. | This feature is in beta and subject to possible change, please provide feedback. @@ -41,11 +46,11 @@ This interactive Python session demonstrates basic operations: >>> problem = Problem() >>> problem.addVariable("a", [1,2,3]) >>> problem.addVariable("b", [4,5,6]) - >>> problem.getSolutions() + >>> problem.getSolutions() # doctest: +NORMALIZE_WHITESPACE [{'a': 3, 'b': 6}, {'a': 3, 'b': 5}, {'a': 3, 'b': 4}, {'a': 2, 'b': 6}, {'a': 2, 'b': 5}, {'a': 2, 'b': 4}, {'a': 1, 'b': 6}, {'a': 1, 'b': 5}, {'a': 1, 'b': 4}] - + >>> problem.addConstraint("a*2 == b") # string constraints are preferable over the black-box problem.addConstraint(lambda a, b: a*2 == b, ("a", "b")) >>> problem.getSolutions() [{'a': 3, 'b': 6}, {'a': 2, 'b': 4}] @@ -53,7 +58,7 @@ This interactive Python session demonstrates basic operations: >>> problem = Problem() >>> problem.addVariables(["a", "b"], [1, 2, 3]) >>> problem.addConstraint(AllDifferentConstraint()) - >>> problem.getSolutions() + >>> problem.getSolutions() # doctest: +NORMALIZE_WHITESPACE [{'a': 3, 'b': 2}, {'a': 3, 'b': 1}, {'a': 2, 'b': 3}, {'a': 2, 'b': 1}, {'a': 1, 'b': 2}, {'a': 1, 'b': 3}] @@ -72,11 +77,9 @@ The following example solves the classical Eight Rooks problem: >>> for col1 in cols: ... for col2 in cols: ... if col1 < col2: - ... problem.addConstraint(lambda row1, row2: row1 != row2, - ... (col1, col2)) + ... problem.addConstraint(lambda row1, row2: row1 != row2, (col1, col2)) >>> solutions = problem.getSolutions() - >>> solutions - >>> solutions + >>> solutions # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS [{0: 7, 1: 6, 2: 5, 3: 4, 4: 3, 5: 2, 6: 1, 7: 0}, {0: 7, 1: 6, 2: 5, 3: 4, 4: 3, 5: 2, 6: 0, 7: 1}, {0: 7, 1: 6, 2: 5, 3: 4, 4: 3, 5: 1, 6: 2, 7: 0}, @@ -103,12 +106,10 @@ This example solves a 4x4 magic square: >>> problem.addConstraint(ExactSumConstraint(34), [0, 5, 10, 15]) >>> problem.addConstraint(ExactSumConstraint(34), [3, 6, 9, 12]) >>> for row in range(4): - ... problem.addConstraint(ExactSumConstraint(34), - [row * 4 + i for i in range(4)]) + ... problem.addConstraint(ExactSumConstraint(34), [row * 4 + i for i in range(4)]) >>> for col in range(4): - ... problem.addConstraint(ExactSumConstraint(34), - [col + 4 * i for i in range(4)]) - >>> solutions = problem.getSolutions() + ... problem.addConstraint(ExactSumConstraint(34), [col + 4 * i for i in range(4)]) + >>> solutions = problem.getSolutions() # doctest: +SKIP Features -------- @@ -159,6 +160,15 @@ Download and install $ pip install python-constraint2 +Conda / Mamba: + +.. code-block:: shell + + $ conda config --add channels conda-forge + $ conda config --set channel_priority strict + $ conda install python-constraint2 + $ mamba install python-constraint2 + Testing ------- @@ -181,6 +191,8 @@ For an overview of recent changes, visit the `Changelog @@ -55,9 +63,6 @@ END: Cython Metadata */ #define DL_EXPORT(t) t #endif #define __PYX_COMMA , -#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -#endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif @@ -90,7 +95,7 @@ END: Cython Metadata */ #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_ASSUME_SAFE_SIZE @@ -127,6 +132,8 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 @@ -194,6 +201,8 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX @@ -204,8 +213,6 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 - #undef CYTHON_CLINE_IN_TRACEBACK - #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS @@ -265,8 +272,11 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #ifndef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 1 + #endif + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 @@ -373,6 +383,15 @@ END: Cython Metadata */ #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif + #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work + #elif !defined(CYTHON_IMMORTAL_CONSTANTS) + #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) + #endif +#endif +#ifndef CYTHON_COMPRESS_STRINGS + #define CYTHON_COMPRESS_STRINGS 1 #endif #ifndef CYTHON_FAST_PYCCALL #define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL @@ -381,10 +400,9 @@ END: Cython Metadata */ #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #else -#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL) #endif #endif -#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #undef SHIFT #undef BASE @@ -460,35 +478,8 @@ END: Cython Metadata */ #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; - #endif - #endif - #if _MSC_VER < 1300 - #ifdef _WIN64 - typedef unsigned long long __pyx_uintptr_t; - #else - typedef unsigned int __pyx_uintptr_t; - #endif - #else - #ifdef _WIN64 - typedef unsigned __int64 __pyx_uintptr_t; - #else - typedef unsigned __int32 __pyx_uintptr_t; - #endif - #endif -#else - #include - typedef uintptr_t __pyx_uintptr_t; -#endif +#include +typedef uintptr_t __pyx_uintptr_t; #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 @@ -531,9 +522,9 @@ END: Cython Metadata */ #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000) #else - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) @@ -637,6 +628,12 @@ static int __Pyx_init_co_variables(void); #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif +#ifndef Py_TPFLAGS_IMMUTABLETYPE + #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8) +#endif +#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION + #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7) +#endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif @@ -669,11 +666,6 @@ static int __Pyx_init_co_variables(void); #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) -#elif CYTHON_BACKPORT_VECTORCALL - typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) @@ -703,7 +695,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(vo #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x03090000 +#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000) #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else @@ -720,6 +712,9 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(vo #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno)) #elif CYTHON_COMPILING_IN_GRAAL #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) @@ -810,7 +805,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #endif #define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) -#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#if CYTHON_USE_TYPE_SPECS #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ @@ -874,7 +869,10 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #endif #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else @@ -890,22 +888,55 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif -#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) - #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS +enum __Pyx_ReferenceSharing { + __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check + __Pyx_ReferenceSharing_OwnStrongReference, + __Pyx_ReferenceSharing_FunctionArgument, + __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar +}; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000 +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\ + (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\ + (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\ + (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0))) +#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1) +#else +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) #else #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i) #endif -#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS - #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE) + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) +#else + #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\ + __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +#endif +#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_PyList_GetItemRef(o, i)) +#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\ + __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ + __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i)) #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\ + __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ + __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i)) #endif +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_NewRef(PyList_GET_ITEM(o, i))) #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_XNewRef(PyList_GetItem(o, i))) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) @@ -966,15 +997,6 @@ static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) -#else - static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { - PyObject *module = PyImport_AddModule(name); - Py_XINCREF(module); - return module; - } -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif @@ -1081,15 +1103,6 @@ static int __Pyx_init_co_variables(void) { #endif #endif #include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else @@ -1138,6 +1151,15 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif +#ifdef CYTHON_FREETHREADING_COMPATIBLE +#if CYTHON_FREETHREADING_COMPATIBLE +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED +#else +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED +#endif +#else +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED +#endif #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING "" @@ -1340,7 +1362,7 @@ static const char* const __pyx_f[] = { "constraint/constraints.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* Atomics.proto */ +/* Atomics.proto (used by UnpackUnboundCMethod) */ #include #ifndef CYTHON_ATOMICS #define CYTHON_ATOMICS 1 @@ -1376,6 +1398,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C atomics") #elif defined(__PYX_DEBUG_ATOMICS) @@ -1400,6 +1423,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C++ atomics") #elif defined(__PYX_DEBUG_ATOMICS) @@ -1409,6 +1433,7 @@ static const char* const __pyx_f[] = { (__GNUC_MINOR__ > 1 ||\ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) #define __pyx_atomic_ptr_type void* + #define __pyx_nonatomic_ptr_type void* #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1) @@ -1424,6 +1449,12 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value) + static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { + __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } #ifdef __PYX_DEBUG_ATOMICS #warning "Using GNU atomics" #endif @@ -1434,6 +1465,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_ptr_type void* #undef __pyx_nonatomic_int_type #define __pyx_nonatomic_int_type long + #define __pyx_nonatomic_ptr_type void* #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer) #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1) #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1) @@ -1450,6 +1482,12 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0) #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value) + static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { + __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } #ifdef __PYX_DEBUG_ATOMICS #pragma message ("Using MSVC atomics") #endif @@ -1460,36 +1498,27 @@ static const char* const __pyx_f[] = { #warning "Not using atomics" #endif #endif -#if CYTHON_ATOMICS - #define __pyx_add_acquisition_count(memview)\ - __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview)) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview)) -#else - #define __pyx_add_acquisition_count(memview)\ - __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) -#endif - -/* IncludeStructmemberH.proto */ -#include -/* CriticalSections.proto */ +/* CriticalSectionsDefinition.proto (used by CriticalSections) */ #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __Pyx_PyCriticalSection void* #define __Pyx_PyCriticalSection2 void* -#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs -#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs -#define __Pyx_PyCriticalSection_End1(cs) -#define __Pyx_PyCriticalSection_End2(cs) +#define __Pyx_PyCriticalSection_End(cs) +#define __Pyx_PyCriticalSection2_End(cs) #else #define __Pyx_PyCriticalSection PyCriticalSection #define __Pyx_PyCriticalSection2 PyCriticalSection2 -#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin -#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin -#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End -#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End +#define __Pyx_PyCriticalSection_End PyCriticalSection_End +#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End +#endif + +/* CriticalSections.proto (used by ParseKeywordsImpl) */ +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs) +#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs) +#else +#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin +#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin #endif #if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_BEGIN_CRITICAL_SECTION(o) { @@ -1499,6 +1528,9 @@ static const char* const __pyx_f[] = { #define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif +/* IncludeStructmemberH.proto (used by FixUpExtensionType) */ +#include + /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ @@ -1513,21 +1545,23 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr; -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr; -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr; -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr; -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr; -/* "constraint/constraints.py":64 +/* "constraint/constraints.py":65 * vconstraints[variable].remove((self, variables)) * * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< @@ -1540,7 +1574,7 @@ struct __pyx_defaults { }; -/* "constraint/constraints.py":393 +/* "constraint/constraints.py":433 * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." # <<<<<<<<<<<<<< @@ -1554,7 +1588,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr { }; -/* "constraint/constraints.py":396 +/* "constraint/constraints.py":436 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -1568,7 +1602,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess { }; -/* "constraint/constraints.py":410 +/* "constraint/constraints.py":450 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -1586,7 +1620,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr { }; -/* "constraint/constraints.py":411 +/* "constraint/constraints.py":451 * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -1604,7 +1638,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr { }; -/* "constraint/constraints.py":540 +/* "constraint/constraints.py":615 * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." # <<<<<<<<<<<<<< @@ -1618,7 +1652,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr { }; -/* "constraint/constraints.py":543 +/* "constraint/constraints.py":618 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -1632,7 +1666,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess { }; -/* "constraint/constraints.py":551 +/* "constraint/constraints.py":626 * for var in self.sum_vars: * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -1650,58 +1684,44 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr { }; -/* "constraint/constraints.py":614 - * variable_with_negative = None - * for variable in variables: - * contains_negative = any(value < 0 for value in domains[variable]) # <<<<<<<<<<<<<< - * variable_contains_negative.append(contains_negative) - * if contains_negative: -*/ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr { - PyObject_HEAD - PyObject *__pyx_genexpr_arg_0; - PyObject *__pyx_v_value; -}; - - -/* "constraint/constraints.py":710 +/* "constraint/constraints.py":794 * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." # <<<<<<<<<<<<<< * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * */ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_m; }; -/* "constraint/constraints.py":713 +/* "constraint/constraints.py":797 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * */ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess { PyObject_HEAD PyObject *__pyx_v_domains; PyObject *__pyx_v_var; }; -/* "constraint/constraints.py":721 +/* "constraint/constraints.py":805 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): */ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *__pyx_outer_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_v; PyObject *__pyx_t_0; @@ -1710,13 +1730,27 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr { }; -/* "constraint/constraints.py":780 +/* "constraint/constraints.py":870 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): */ +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr { + PyObject_HEAD + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_value; +}; + + +/* "constraint/constraints.py":899 + * if len(self._variable_contains_lt1) != len(variables): + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) # <<<<<<<<<<<<<< + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: +*/ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1724,7 +1758,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr { }; -/* "constraint/constraints.py":890 +/* "constraint/constraints.py":990 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -1734,11 +1768,10 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr { struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ { PyObject_HEAD PyObject *__pyx_v_assigned_product; - PyObject *__pyx_v_target_value; }; -/* "constraint/constraints.py":913 +/* "constraint/constraints.py":1013 * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned_vars] * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] * possible_min = min(assigned_product * c for c in candidates) # <<<<<<<<<<<<<< @@ -1755,7 +1788,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr { }; -/* "constraint/constraints.py":914 +/* "constraint/constraints.py":1014 * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] * possible_min = min(assigned_product * c for c in candidates) * possible_max = max(assigned_product * c for c in candidates) # <<<<<<<<<<<<<< @@ -1772,56 +1805,55 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr { }; -/* "constraint/constraints.py":928 - * for value in domain[:]: - * candidates = [assigned_product * value * p for p in other_products] - * if all(c != target_value for c in candidates): # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: -*/ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr { - PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *__pyx_outer_scope; - PyObject *__pyx_genexpr_arg_0; - PyObject *__pyx_v_c; -}; - - -/* "constraint/constraints.py":1034 +/* "constraint/constraints.py":1146 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * if self.target_var not in assignments: * return True # Can't evaluate yet */ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ { PyObject_HEAD PyObject *__pyx_v_target_value; }; -/* "constraint/constraints.py":1070 +/* "constraint/constraints.py":1182 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): # <<<<<<<<<<<<<< * domain.hideValue(val) * if not domain: */ -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr { +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *__pyx_outer_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_p; }; -/* "constraint/constraints.py":1104 +/* "constraint/constraints.py":1222 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): */ +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr { + PyObject_HEAD + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_value; +}; + + +/* "constraint/constraints.py":1251 + * if len(self._variable_contains_lt1) != len(variables): + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) # <<<<<<<<<<<<<< + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: +*/ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1829,7 +1861,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr { }; -/* "constraint/constraints.py":1205 +/* "constraint/constraints.py":1333 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -1842,7 +1874,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ { }; -/* "constraint/constraints.py":1241 +/* "constraint/constraints.py":1369 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): # <<<<<<<<<<<<<< @@ -1856,6 +1888,36 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr { PyObject *__pyx_v_p; }; + +/* "constraint/constraints.py":1571 + * # Utility functions + * + * def sum_other_vars(variables: Sequence, variable, values: dict): # <<<<<<<<<<<<<< + * """Calculate the sum of the given values of all other variables.""" + * return sum(values[v] for v in variables if v != variable) +*/ +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars { + PyObject_HEAD + PyObject *__pyx_v_values; + PyObject *__pyx_v_variable; +}; + + +/* "constraint/constraints.py":1573 + * def sum_other_vars(variables: Sequence, variable, values: dict): + * """Calculate the sum of the given values of all other variables.""" + * return sum(values[v] for v in variables if v != variable) # <<<<<<<<<<<<<< +*/ +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr { + PyObject_HEAD + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars *__pyx_outer_scope; + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_v; + PyObject *__pyx_t_0; + Py_ssize_t __pyx_t_1; + PyObject *(*__pyx_t_2)(PyObject *); +}; + /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ @@ -1932,7 +1994,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr { #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) -/* PyErrExceptionMatches.proto */ +/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); @@ -1940,7 +2002,7 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif -/* PyThreadStateGet.proto */ +/* PyThreadStateGet.proto (used by PyErrFetchRestore) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; @@ -1958,7 +2020,7 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif -/* PyErrFetchRestore.proto */ +/* PyErrFetchRestore.proto (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) @@ -1983,20 +2045,20 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif -/* PyObjectGetAttrStr.proto */ +/* PyObjectGetAttrStr.proto (used by PyObjectGetAttrStrNoError) */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif -/* PyObjectGetAttrStrNoError.proto */ +/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); -/* TupleAndListFromArray.proto */ +/* TupleAndListFromArray.proto (used by fastcall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -2004,13 +2066,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_s static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif -/* IncludeStringH.proto */ +/* IncludeStringH.proto (used by BytesEquals) */ #include -/* BytesEquals.proto */ +/* BytesEquals.proto (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); -/* UnicodeEquals.proto */ +/* UnicodeEquals.proto (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ @@ -2043,25 +2105,16 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #endif #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) -#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#if CYTHON_METH_FASTCALL #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start) #else -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS #endif -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); +/* py_dict_items.proto (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); -/* ParseKeywords.proto */ -static CYTHON_INLINE int __Pyx_ParseKeywords( - PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], - PyObject *kwds2, PyObject *values[], - Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, - const char* function_name, - int ignore_unknown_kwargs -); - -/* CallCFunction.proto */ +/* CallCFunction.proto (used by CallUnboundCMethod0) */ #define __Pyx_CallCFunction(cfunc, self, args)\ ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) #define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ @@ -2071,52 +2124,26 @@ static CYTHON_INLINE int __Pyx_ParseKeywords( #define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\ ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames) -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#if !CYTHON_VECTORCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs); -#endif -#define __Pyx_BUILD_ASSERT_EXPR(cond)\ - (sizeof(char [1 - 2*!(cond)]) - 1) -#ifndef Py_MEMBER_SIZE -#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) -#endif -#if !CYTHON_VECTORCALL -#if PY_VERSION_HEX >= 0x03080000 - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets() - #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) -#else - static size_t __pyx_pyframe_localsplus_offset = 0; - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets()\ - ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ - (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) - #define __Pyx_PyFrame_GetLocalsplus(frame)\ - (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) -#endif -#endif -#endif - -/* PyObjectCall.proto */ +/* PyObjectCall.proto (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif -/* PyObjectCallMethO.proto */ +/* PyObjectCallMethO.proto (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif -/* PyObjectFastCall.proto */ +/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); -/* UnpackUnboundCMethod.proto */ +/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */ typedef struct { PyObject *type; PyObject **method_name; @@ -2149,6 +2176,59 @@ static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_Ca #define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) #endif +/* CallUnboundCMethod0.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + +/* py_dict_values.proto (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); + +/* OwnedDictNext.proto (used by ParseKeywordsImpl) */ +#if CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue); +#else +CYTHON_INLINE +static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue); +#endif + +/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywordsImpl.export */ +static int __Pyx_ParseKeywordsTuple( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name +); +static int __Pyx_ParseKeywordDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + /* CallUnboundCMethod2.proto */ CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); @@ -2158,37 +2238,48 @@ static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction * #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif +/* ParseKeywords.proto */ +static CYTHON_INLINE int __Pyx_ParseKeywords( + PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], + PyObject *kwds2, PyObject *values[], + Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); +/* ArgTypeTestFunc.export */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* GetItemInt.proto */ -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ + int wraparound, int boundscheck, int unsafe_shared); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); + int wraparound, int boundscheck, int unsafe_shared); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); + int is_list, int wraparound, int boundscheck, int unsafe_shared); /* DictGetItem.proto */ #if !CYTHON_COMPILING_IN_PYPY @@ -2214,7 +2305,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf); #endif -/* PyObjectCall2Args.proto */ +/* PyObjectCall2Args.proto (used by CallUnboundCMethod1) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* CallUnboundCMethod1.proto */ @@ -2232,7 +2323,7 @@ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } -/* PyObjectDelAttr.proto */ +/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 #define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL) #else @@ -2280,43 +2371,45 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2 /* PyLongCompare.proto */ static CYTHON_INLINE PyObject* __Pyx_PyLong_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); -/* RaiseException.proto */ +/* PyNotImplementedError_Check.proto */ +#define __Pyx_PyExc_NotImplementedError_Check(obj) __Pyx_TypeCheck(obj, PyExc_NotImplementedError) + +/* RaiseException.export */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* dict_getitem_default.proto */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); -/* IterFinish.proto */ +/* IterFinish.proto (used by dict_iter) */ static CYTHON_INLINE int __Pyx_IterFinish(void); -/* PyObjectCallNoArg.proto */ +/* PyObjectCallNoArg.proto (used by PyObjectCallMethod0) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* PyObjectGetMethod.proto */ +/* PyObjectGetMethod.proto (used by PyObjectCallMethod0) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); +#endif -/* PyObjectCallMethod0.proto */ +/* PyObjectCallMethod0.proto (used by dict_iter) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); -/* RaiseNeedMoreValuesToUnpack.proto */ +/* RaiseNeedMoreValuesToUnpack.proto (used by UnpackTuple2) */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -/* RaiseTooManyValuesToUnpack.proto */ +/* RaiseTooManyValuesToUnpack.proto (used by UnpackItemEndCheck) */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); -/* UnpackItemEndCheck.proto */ +/* UnpackItemEndCheck.proto (used by UnpackTuple2) */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); -/* RaiseNoneIterError.proto */ +/* RaiseNoneIterError.proto (used by UnpackTupleError) */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); -/* UnpackTupleError.proto */ +/* UnpackTupleError.proto (used by UnpackTuple2) */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); -/* UnpackTuple2.proto */ +/* UnpackTuple2.proto (used by dict_iter) */ static CYTHON_INLINE int __Pyx_unpack_tuple2( PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( @@ -2336,7 +2429,7 @@ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* s return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } -/* PyDictVersioning.proto */ +/* PyDictVersioning.proto (used by GetModuleGlobalName) */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) @@ -2347,7 +2440,7 @@ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* s static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ + (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ @@ -2383,10 +2476,17 @@ static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_ve static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + /* RaiseUnboundLocalError.proto */ static void __Pyx_RaiseUnboundLocalError(const char *varname); -/* GetException.proto */ +/* GetException.proto (used by pep479) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); @@ -2398,9 +2498,12 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); /* AssertionsEnabled.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000 static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) + #if __clang__ || __GNUC__ + __attribute__((no_sanitize("thread"))) + #endif static int __Pyx_init_assertions_enabled(void) { PyObject *builtins, *debug, *debug_str; int flag; @@ -2425,20 +2528,16 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif +/* PyAssertionError_Check.proto */ +#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError) + /* PyLongCompare.proto */ static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* RaiseClosureNameError.proto */ static void __Pyx_RaiseClosureNameError(const char *varname); -/* ObjectGetItem.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); -#else -#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) -#endif - -/* PyObjectCallMethod1.proto */ +/* PyObjectCallMethod1.proto (used by append) */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* append.proto */ @@ -2468,7 +2567,7 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif -/* PyObjectVectorCallKwBuilder.proto */ +/* PyObjectVectorCallKwBuilder.proto (used by PyObjectVectorCallMethodKwBuilder) */ CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); #if CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03090000 @@ -2493,6 +2592,12 @@ static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, P static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames); #endif +/* PyRuntimeError_Check.proto */ +#define __Pyx_PyExc_RuntimeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_RuntimeError) + +/* AllocateExtensionType.proto */ +static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final); + /* CallTypeTraverse.proto */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 @@ -2500,19 +2605,33 @@ static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, P static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif -/* LimitedApiGetTypeDict.proto */ +/* CheckTypeForFreelists.proto */ +#if CYTHON_USE_FREELISTS +#if CYTHON_USE_TYPE_SPECS +#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp))) +#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS Py_TPFLAGS_IS_ABSTRACT +#else +#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size))) +#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE) +#endif +#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\ + (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\ + (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS))) +#endif + +/* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); #endif -/* SetItemOnTypeDict.proto */ +/* SetItemOnTypeDict.proto (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v); #define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v) /* FixUpExtensionType.proto */ static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -/* ValidateBasesTuple.proto */ +/* ValidateBasesTuple.proto (used by PyType_Ready) */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif @@ -2520,37 +2639,52 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); -/* ListPack.proto */ -static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); +/* HasAttr.proto (used by ImportImpl) */ +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) +#else +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); +#endif + +/* ImportImpl.export */ +static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level); /* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); -/* FetchSharedCythonModule.proto */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void); +/* dict_setdefault.proto (used by FetchCommonType) */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value); -/* dict_setdefault.proto */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); +/* AddModuleRef.proto (used by FetchSharedCythonModule) */ +#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\ + __PYX_LIMITED_VERSION_HEX < 0x030d0000) + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name); +#else + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#endif + +/* FetchSharedCythonModule.proto (used by FetchCommonType) */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); -/* FetchCommonType.proto */ +/* FetchCommonType.proto (used by CommonTypesMetaclass) */ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); -/* CommonTypesMetaclass.proto */ +/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */ static int __pyx_CommonTypesMetaclass_init(PyObject *module); #define __Pyx_CommonTypesMetaclass_USED -/* PyMethodNew.proto */ +/* PyMethodNew.proto (used by CythonFunctionShared) */ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); -/* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */ +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif -/* CythonFunctionShared.proto */ +/* CythonFunctionShared.proto (used by CythonFunction) */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 @@ -2580,14 +2714,15 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL ||\ - (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) +#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL __pyx_vectorcallfunc func_vectorcall; #endif #if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_dict; +#endif PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; @@ -2632,7 +2767,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) @@ -2657,10 +2792,10 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif -/* CalculateMetaclass.proto */ +/* CalculateMetaclass.proto (used by Py3ClassCreate) */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); -/* PyObjectLookupSpecial.proto */ +/* PyObjectLookupSpecial.proto (used by Py3ClassCreate) */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) @@ -2679,14 +2814,14 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); -/* CLineInTraceback.proto */ +/* CLineInTraceback.proto (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #else #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif -/* CodeObjectCache.proto */ +/* CodeObjectCache.proto (used by AddTraceback) */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject __Pyx_CachedCodeObjectType; #else @@ -2767,12 +2902,21 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) #endif -/* GetTopmostException.proto */ +/* GetRuntimeVersion.proto */ +#if __PYX_LIMITED_VERSION_HEX < 0x030b0000 +static unsigned long __Pyx_cached_runtime_version = 0; +static void __Pyx_init_runtime_version(void); +#else +#define __Pyx_init_runtime_version() +#endif +static unsigned long __Pyx_get_runtime_version(void); + +/* GetTopmostException.proto (used by SaveResetException) */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif -/* SaveResetException.proto */ +/* SaveResetException.proto (used by CoroutineBase) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); @@ -2783,7 +2927,7 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif -/* SwapException.proto */ +/* SwapException.proto (used by CoroutineBase) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); @@ -2791,16 +2935,16 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif -/* IterNextPlain.proto */ +/* IterNextPlain.proto (used by CoroutineBase) */ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator); #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void); #endif -/* ReturnWithStopIteration.proto */ +/* ReturnWithStopIteration.proto (used by CoroutineBase) */ static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext); -/* CoroutineBase.proto */ +/* CoroutineBase.proto (used by Generator) */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); #if CYTHON_USE_EXC_INFO_STACK @@ -2817,7 +2961,9 @@ typedef struct __pyx_CoroutineObject { __pyx_coroutine_body_t body; PyObject *closure; __Pyx_ExcInfoStruct gi_exc_state; +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *gi_weakreflist; +#endif PyObject *classobj; PyObject *yieldfrom; __Pyx_pyiter_sendfunc yieldfrom_am_send; @@ -2885,12 +3031,12 @@ static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); -/* GetRuntimeVersion.proto */ -static unsigned long __Pyx_get_runtime_version(void); - /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); +/* DecompressString.proto */ +static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo); + /* MultiPhaseInitModuleState.proto */ #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE static PyObject *__Pyx_State_FindModule(void*); @@ -2948,369 +3094,27 @@ int __pyx_module_is_main_constraint__constraints = 0; /* Implementation of "constraint.constraints" */ /* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_zip; -static PyObject *__pyx_builtin_round; -static PyObject *__pyx_builtin_AssertionError; +static PyObject *__pyx_builtin_min; static PyObject *__pyx_builtin_max; +static PyObject *__pyx_builtin_round; static PyObject *__pyx_builtin_sum; -static PyObject *__pyx_builtin_min; -static PyObject *__pyx_builtin_RuntimeError; /* #### Code section: string_decls ### */ -static const char __pyx_k_[] = "."; -static const char __pyx_k_A[] = "\240A"; -static const char __pyx_k_L[] = "\320\004 \240\001\360\014\000\t\r\210L\230\001"; -static const char __pyx_k_N[] = "\320\004\"\240!\360\014\000\t\r\210N\230!"; -static const char __pyx_k_Q[] = "\240Q"; -static const char __pyx_k_b[] = "b"; -static const char __pyx_k_c[] = "c"; -static const char __pyx_k_m[] = "m"; -static const char __pyx_k_n[] = "n"; -static const char __pyx_k_o[] = "o"; -static const char __pyx_k_p[] = "p"; -static const char __pyx_k_v[] = "v"; -static const char __pyx_k_x[] = "x"; -static const char __pyx_k__2[] = "?"; -static const char __pyx_k__3[] = "\240\021"; -static const char __pyx_k__4[] = "\250!"; -static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k_hi[] = "hi"; -static const char __pyx_k_lo[] = "lo"; -static const char __pyx_k_A_2[] = "\250A"; -static const char __pyx_k_Q_2[] = "\230Q"; -static const char __pyx_k_doc[] = "__doc__"; -static const char __pyx_k_dom[] = "dom"; -static const char __pyx_k_get[] = "get"; -static const char __pyx_k_max[] = "max"; -static const char __pyx_k_min[] = "min"; -static const char __pyx_k_n_2[] = "_n"; -static const char __pyx_k_pop[] = "pop"; -static const char __pyx_k_set[] = "set"; -static const char __pyx_k_str[] = "str"; -static const char __pyx_k_sum[] = "sum"; -static const char __pyx_k_val[] = "val"; -static const char __pyx_k_var[] = "var"; -static const char __pyx_k_zip[] = "zip"; -static const char __pyx_k_A_HA[] = "\200A\360\014\000\t\r\210H\220A"; -static const char __pyx_k_bool[] = "bool"; -static const char __pyx_k_call[] = "__call__"; -static const char __pyx_k_dict[] = "dict"; -static const char __pyx_k_func[] = "func"; -static const char __pyx_k_init[] = "__init__"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_next[] = "next"; -static const char __pyx_k_prod[] = "prod"; -static const char __pyx_k_seen[] = "seen"; -static const char __pyx_k_self[] = "self"; -static const char __pyx_k_send[] = "send"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_88XXY[] = "\320\0048\3208X\320XY\330\010\016\320\016!\240\021\240!"; -static const char __pyx_k_8_l_1[] = "\320\0048\270\001\340\010\016\210l\230!\2301"; -static const char __pyx_k_Union[] = "Union"; -static const char __pyx_k_close[] = "close"; -static const char __pyx_k_exact[] = "exact"; -static const char __pyx_k_found[] = "found"; -static const char __pyx_k_index[] = "index"; -static const char __pyx_k_parms[] = "parms"; -static const char __pyx_k_prods[] = "prods"; -static const char __pyx_k_round[] = "round"; -static const char __pyx_k_set_2[] = "_set"; -static const char __pyx_k_t_max[] = "t_max"; -static const char __pyx_k_t_min[] = "t_min"; -static const char __pyx_k_throw[] = "throw"; -static const char __pyx_k_value[] = "value"; -static const char __pyx_k_4M_M_A[] = "\320\004!\320!4\260M\300\021\360\022\000\t\r\210M\230\021\330\010\014\320\014\034\230A"; -static const char __pyx_k_6a_N_A[] = "\320\004#\320#6\260a\360\016\000\t\r\210N\230!\330\010\014\320\014\034\230A"; -static const char __pyx_k_append[] = "append"; -static const char __pyx_k_bounds[] = "bounds"; -static const char __pyx_k_domain[] = "domain"; -static const char __pyx_k_enable[] = "enable"; -static const char __pyx_k_func_2[] = "_func"; -static const char __pyx_k_func_3[] = "__func__"; -static const char __pyx_k_maxsum[] = "maxsum"; -static const char __pyx_k_maxval[] = "maxval"; -static const char __pyx_k_minsum[] = "minsum"; -static const char __pyx_k_minval[] = "minval"; -static const char __pyx_k_module[] = "__module__"; -static const char __pyx_k_others[] = "others"; -static const char __pyx_k_remove[] = "remove"; -static const char __pyx_k_typing[] = "typing"; -static const char __pyx_k_values[] = "values"; -static const char __pyx_k_55H_a_q[] = "\320\004\"\320\"5\3205H\310\006\310a\360.\000\t\020\210q"; -static const char __pyx_k_Zz_IQ_M[] = "\320\004\035\230Z\240z\260\021\360\022\000\t\r\210I\220Q\330\010\014\210M\230\021"; -static const char __pyx_k_disable[] = "disable"; -static const char __pyx_k_domains[] = "domains"; -static const char __pyx_k_exact_2[] = "_exact"; -static const char __pyx_k_genexpr[] = "genexpr"; -static const char __pyx_k_maxprod[] = "maxprod"; -static const char __pyx_k_minprod[] = "minprod"; -static const char __pyx_k_missing[] = "missing"; -static const char __pyx_k_prepare[] = "__prepare__"; -static const char __pyx_k_product[] = "product"; -static const char __pyx_k_2_q_Kq_A[] = "\320\004\037\320\0372\260-\270q\360\022\000\t\r\210K\220q\330\010\014\320\014\034\230A"; -static const char __pyx_k_6a_N_A_2[] = "\320\004#\320#6\260a\330\010\014\210N\230!\330\010\014\320\014\034\230A"; -static const char __pyx_k_Callable[] = "Callable"; -static const char __pyx_k_Optional[] = "Optional"; -static const char __pyx_k_Sequence[] = "Sequence"; -static const char __pyx_k_U_A_IQ_M[] = "\320\004\035\230U\240*\250A\330\010\014\210I\220Q\330\010\014\210M\230\021"; -static const char __pyx_k_add_note[] = "add_note"; -static const char __pyx_k_assigned[] = "assigned"; -static const char __pyx_k_exactsum[] = "exactsum"; -static const char __pyx_k_maxsum_2[] = "_maxsum"; -static const char __pyx_k_minsum_2[] = "_minsum"; -static const char __pyx_k_products[] = "products"; -static const char __pyx_k_qualname[] = "__qualname__"; -static const char __pyx_k_set_name[] = "__set_name__"; -static const char __pyx_k_sum_vars[] = "sum_vars"; -static const char __pyx_k_temp_sum[] = "temp_sum"; -static const char __pyx_k_variable[] = "variable"; -static const char __pyx_k_A_q_E_A_q[] = "\200A\330\010\017\210q\330\010\014\210E\220\021\330\014\024\220A\330\010\017\210q"; -static const char __pyx_k_E_HA_F_Ja[] = "\320\004\034\230E\240\021\360\024\000\t\r\210H\220A\330\010\014\210F\220!\330\010\014\210J\220a"; -static const char __pyx_k_exactprod[] = "exactprod"; -static const char __pyx_k_hideValue[] = "hideValue"; -static const char __pyx_k_isenabled[] = "isenabled"; -static const char __pyx_k_itertools[] = "itertools"; -static const char __pyx_k_maxprod_2[] = "_maxprod"; -static const char __pyx_k_metaclass[] = "__metaclass__"; -static const char __pyx_k_minprod_2[] = "_minprod"; -static const char __pyx_k_other_max[] = "other_max"; -static const char __pyx_k_other_min[] = "other_min"; -static const char __pyx_k_sum_value[] = "sum_value"; -static const char __pyx_k_variables[] = "variables"; -static const char __pyx_k_Constraint[] = "Constraint"; -static const char __pyx_k_Unassigned[] = "Unassigned"; -static const char __pyx_k_all_bounds[] = "all_bounds"; -static const char __pyx_k_assigned_2[] = "_assigned"; -static const char __pyx_k_candidates[] = "candidates"; -static const char __pyx_k_exactsum_2[] = "_exactsum"; -static const char __pyx_k_list_tuple[] = "list[tuple]"; -static const char __pyx_k_max_others[] = "max_others"; -static const char __pyx_k_min_others[] = "min_others"; -static const char __pyx_k_multiplier[] = "multiplier"; -static const char __pyx_k_others_max[] = "others_max"; -static const char __pyx_k_others_min[] = "others_min"; -static const char __pyx_k_preProcess[] = "preProcess"; -static const char __pyx_k_target_dom[] = "target_dom"; -static const char __pyx_k_target_max[] = "target_max"; -static const char __pyx_k_target_min[] = "target_min"; -static const char __pyx_k_target_var[] = "target_var"; -static const char __pyx_k_unassigned[] = "_unassigned"; -static const char __pyx_k_assignments[] = "assignments"; -static const char __pyx_k_constraints[] = "constraints"; -static const char __pyx_k_domain_dict[] = "domain_dict"; -static const char __pyx_k_exactprod_2[] = "_exactprod"; -static const char __pyx_k_exclude_var[] = "exclude_var"; -static const char __pyx_k_missing_lt1[] = "missing_lt1"; -static const char __pyx_k_mro_entries[] = "__mro_entries__"; -static const char __pyx_k_multipliers[] = "multipliers"; -static const char __pyx_k_singlevalue[] = "singlevalue"; -static const char __pyx_k_Can_t_happen[] = "Can't happen"; -static const char __pyx_k_RuntimeError[] = "RuntimeError"; -static const char __pyx_k_Sequence_str[] = "Sequence[str]"; -static const char __pyx_k_contains_lt1[] = "contains_lt1"; -static const char __pyx_k_forwardCheck[] = "forwardCheck"; -static const char __pyx_k_forwardcheck[] = "forwardcheck"; -static const char __pyx_k_is_coroutine[] = "_is_coroutine"; -static const char __pyx_k_possible_max[] = "possible_max"; -static const char __pyx_k_possible_min[] = "possible_min"; -static const char __pyx_k_product_vars[] = "product_vars"; -static const char __pyx_k_safe_product[] = "_safe_product"; -static const char __pyx_k_target_value[] = "target_value"; -static const char __pyx_k_unassigned_2[] = "unassigned"; -static const char __pyx_k_vconstraints[] = "vconstraints"; -static const char __pyx_k_assigned_prod[] = "assigned_prod"; -static const char __pyx_k_class_getitem[] = "__class_getitem__"; -static const char __pyx_k_domain_bounds[] = "domain_bounds"; -static const char __pyx_k_multipliers_2[] = "_multipliers"; -static const char __pyx_k_others_bounds[] = "others_bounds"; -static const char __pyx_k_target_domain[] = "target_domain"; -static const char __pyx_k_AssertionError[] = "AssertionError"; -static const char __pyx_k_other_products[] = "other_products"; -static const char __pyx_k_possible_prods[] = "possible_prods"; -static const char __pyx_k_InSetConstraint[] = "InSetConstraint"; -static const char __pyx_k_Union_int_float[] = "Union[int, float]"; -static const char __pyx_k_collections_abc[] = "collections.abc"; -static const char __pyx_k_unassigned_vars[] = "unassigned_vars"; -static const char __pyx_k_MaxSumConstraint[] = "MaxSumConstraint"; -static const char __pyx_k_MinSumConstraint[] = "MinSumConstraint"; -static const char __pyx_k_assigned_product[] = "assigned_product"; -static const char __pyx_k_other_unassigned[] = "other_unassigned"; -static const char __pyx_k_Constraint___call[] = "Constraint.__call__"; -static const char __pyx_k_MaxProdConstraint[] = "MaxProdConstraint"; -static const char __pyx_k_MinProdConstraint[] = "MinProdConstraint"; -static const char __pyx_k_Optional_Sequence[] = "Optional[Sequence]"; -static const char __pyx_k_constraint_domain[] = "constraint.domain"; -static const char __pyx_k_contains_negative[] = "contains_negative"; -static const char __pyx_k_variable_with_lt1[] = "variable_with_lt1"; -static const char __pyx_k_AllEqualConstraint[] = "AllEqualConstraint"; -static const char __pyx_k_ExactSumConstraint[] = "ExactSumConstraint"; -static const char __pyx_k_FunctionConstraint[] = "FunctionConstraint"; -static const char __pyx_k_NotInSetConstraint[] = "NotInSetConstraint"; -static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; -static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_get_product_bounds[] = "_get_product_bounds"; -static const char __pyx_k_unassignedvariable[] = "unassignedvariable"; -static const char __pyx_k_ExactProdConstraint[] = "ExactProdConstraint"; -static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; -static const char __pyx_k_SomeInSetConstraint[] = "SomeInSetConstraint"; -static const char __pyx_k_Constraint_preProcess[] = "Constraint.preProcess"; -static const char __pyx_k_variable_contains_lt1[] = "_variable_contains_lt1"; -static const char __pyx_k_AllDifferentConstraint[] = "AllDifferentConstraint"; -static const char __pyx_k_InSetConstraint___call[] = "InSetConstraint.__call__"; -static const char __pyx_k_InSetConstraint___init[] = "InSetConstraint.__init__"; -static const char __pyx_k_SomeNotInSetConstraint[] = "SomeNotInSetConstraint"; -static const char __pyx_k_constraint_constraints[] = "constraint.constraints"; -static const char __pyx_k_variable_with_negative[] = "variable_with_negative"; -static const char __pyx_k_Constraint_forwardCheck[] = "Constraint.forwardCheck"; -static const char __pyx_k_MaxSumConstraint___call[] = "MaxSumConstraint.__call__"; -static const char __pyx_k_MaxSumConstraint___init[] = "MaxSumConstraint.__init__"; -static const char __pyx_k_MinSumConstraint___call[] = "MinSumConstraint.__call__"; -static const char __pyx_k_MinSumConstraint___init[] = "MinSumConstraint.__init__"; -static const char __pyx_k_MaxProdConstraint___call[] = "MaxProdConstraint.__call__"; -static const char __pyx_k_MaxProdConstraint___init[] = "MaxProdConstraint.__init__"; -static const char __pyx_k_MinProdConstraint___call[] = "MinProdConstraint.__call__"; -static const char __pyx_k_MinProdConstraint___init[] = "MinProdConstraint.__init__"; -static const char __pyx_k_VariableMaxSumConstraint[] = "VariableMaxSumConstraint"; -static const char __pyx_k_VariableMinSumConstraint[] = "VariableMinSumConstraint"; -static const char __pyx_k_77JJeef_d_L_WAQ_q_6_6_7_F[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\016\210d\220!\330\010\014\210L\230\001\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\027\240\001\330\024\032\230'\240\021\240!\330\014\030\230\001\230\031\240'\250\022\2506\260\021\330\010\023\2207\230\"\230F\240!"; -static const char __pyx_k_AllEqualConstraint___call[] = "AllEqualConstraint.__call__"; -static const char __pyx_k_ExactSumConstraint___call[] = "ExactSumConstraint.__call__"; -static const char __pyx_k_ExactSumConstraint___init[] = "ExactSumConstraint.__init__"; -static const char __pyx_k_FunctionConstraint___call[] = "FunctionConstraint.__call__"; -static const char __pyx_k_FunctionConstraint___init[] = "FunctionConstraint.__init__"; -static const char __pyx_k_NotInSetConstraint___call[] = "NotInSetConstraint.__call__"; -static const char __pyx_k_NotInSetConstraint___init[] = "NotInSetConstraint.__init__"; -static const char __pyx_k_VariableMaxProdConstraint[] = "VariableMaxProdConstraint"; -static const char __pyx_k_VariableMinProdConstraint[] = "VariableMinProdConstraint"; -static const char __pyx_k_a_N_L_A_1_3a_Cs_Rs_J_b_3c[] = "\320\004#\240?\260/\300\035\310a\360\024\000\t\r\210N\230!\330\010\014\210L\230\001\330\010\014\320\014\034\230A\340\010\013\2101\330\014\023\2203\220a\220}\240C\240s\250!\250:\260R\260s\270!\330\014!\320!J\310!\330\014\023\220;\230b\240\003\2403\240c\250\021"; -static const char __pyx_k_constraint_constraints_py[] = "constraint/constraints.py"; -static const char __pyx_k_ExactProdConstraint___call[] = "ExactProdConstraint.__call__"; -static const char __pyx_k_ExactProdConstraint___init[] = "ExactProdConstraint.__init__"; -static const char __pyx_k_InSetConstraint_preProcess[] = "InSetConstraint.preProcess"; -static const char __pyx_k_SomeInSetConstraint___call[] = "SomeInSetConstraint.__call__"; -static const char __pyx_k_SomeInSetConstraint___init[] = "SomeInSetConstraint.__init__"; -static const char __pyx_k_VariableExactSumConstraint[] = "VariableExactSumConstraint"; -static const char __pyx_k_variable_contains_negative[] = "variable_contains_negative"; -static const char __pyx_k_77JJeef_d_L_WAQ_q_6_A_6_7_F[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\016\210d\220!\330\010\014\210L\230\001\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\023\230A\330\024\032\230'\240\021\240!\330\014\030\230\001\230\031\240'\250\022\2506\260\021\330\010\023\2207\230\"\230F\240!"; -static const char __pyx_k_MaxSumConstraint_preProcess[] = "MaxSumConstraint.preProcess"; -static const char __pyx_k_Multipliers_must_be_numbers[] = "Multipliers must be numbers."; -static const char __pyx_k_VariableExactProdConstraint[] = "VariableExactProdConstraint"; -static const char __pyx_k_CompilableFunctionConstraint[] = "CompilableFunctionConstraint"; -static const char __pyx_k_MaxProdConstraint_preProcess[] = "MaxProdConstraint.preProcess"; -static const char __pyx_k_MinProdConstraint_preProcess[] = "MinProdConstraint.preProcess"; -static const char __pyx_k_AllDifferentConstraint___call[] = "AllDifferentConstraint.__call__"; -static const char __pyx_k_ExactSumConstraint_preProcess[] = "ExactSumConstraint.preProcess"; -static const char __pyx_k_NotInSetConstraint_preProcess[] = "NotInSetConstraint.preProcess"; -static const char __pyx_k_SomeNotInSetConstraint___call[] = "SomeNotInSetConstraint.__call__"; -static const char __pyx_k_SomeNotInSetConstraint___init[] = "SomeNotInSetConstraint.__init__"; -static const char __pyx_k_55H_a_4_7_1_4q_Q_G4q_t3a_AQ_4q[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\013\2104\210|\2307\240!\330\014\023\2201\340\010\027\220{\240!\2404\240q\330\010\030\230\001\330\010\025\220Q\340\010\014\210G\2204\220q\330\014\017\210t\2203\220a\330\020!\240\033\250A\250Q\340\020\032\230'\240\021\240!\340\010\013\2104\210q\330\014\023\220>\240\023\240A\360\006\000\t\031\230\002\230#\230Q\230g\240Q\240e\2503\250a\250w\260a\260u\270D\300\005\300Q\330\010\025\220Q\220d\230.\250\001\250\023\250D\260\005\260W\270B\270b\300\004\300D\310\004\310D\320PV\320VW\330\010\031\230\021\230.\250\002\250\"\250D\260\005\260Q\330\010\013\2103\210a\320\017\037\230r\240\021\330\014\023\2201\340\010\013\2101\330\014\020\220\007\220q\330\020#\2401\240B\240d\250%\250{\270#\270R\270s\300!\330\020\023\2201\330\024\035\230R\230s\240!\2407\250!\2505\260\003\2601\260G\2701\270E\300\024\300U\310!\330\024%\240Q\240d\250.\270\001\270\023\270D\300\005\300W\310B\310b\320PT\320TX\320X\\\320\\`\320`f\320fg\340\024%\240Q\240a\340\020\031\230\027\240\001\240\021\330\020\024\220G\2306\240\021\330\024\034\230A\230^\2502\250T\260\022\2602\260T\270\025\270a\330\024\035\230Q\330\030\036\230j\250\001\250\021\330\020\023\2204\220q\330\024\033\2301\340\010\017\210q"; -static const char __pyx_k_55H_a_D_q_a_J_c_T_y_1_1A_1_waq[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\024\220D\230\001\330\010\017\210q\330\010\022\220!\330\010\026\220a\330\010\014\210J\320\026&\240c\250\021\250+\260T\270\021\330\014\017\210y\230\003\2301\330\020\030\230\013\2401\240A\340\020\032\230!\330\020\023\2201\330\024\037\230w\240a\240q\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\014\210D\220\010\230\004\230E\240\023\240K\250t\2603\260a\260}\300C\300r\310\024\310U\320RT\320TU\330\014\023\2201\330\010\013\2101\330\014\020\220\014\230A\330\020\023\2209\230G\240<\250u\260I\270W\300L\320PS\320SV\320VW\320Wd\320dg\320gh\330\024\035\230W\240A\240Q\330\024\030\230\t\240\026\240q\330\030\033\2305\240\002\240&\250\002\250!\330\034\"\240*\250A\250Q\330\024\027\220t\2301\330\030\037\230q\330\010\017\210q"; -static const char __pyx_k_55H_a_L_y_q_q_a_q_L_Kq_QfA_5_q[] = "\320\004\"\320\"5\3205H\310\006\310a\340\010\014\210L\230\001\330\014\017\210y\230\007\230q\330\020\027\220q\360\006\000\t\023\220$\220a\330\010\017\210q\330\010\014\210L\230\001\330\014\024\220K\230q\240\001\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\017\210u\220C\220q"; -static const char __pyx_k_55H_a_L_y_q_q_d_Q_a_1_1Kq_Rq_A[] = "\320\004\"\320\"5\3205H\310\006\310a\340\010\014\210L\230\001\330\014\017\210y\230\007\230q\330\020\027\220q\360\006\000\t\027\220d\230!\330\010\021\220\024\220Q\330\010\016\210a\330\010\013\2101\330\014\020\220\n\230.\250\003\2501\250K\260q\330\020\027\220{\240!\240:\250R\250q\340\014\020\220\014\230A\330\020\027\220{\240!\2401\330\010\013\210:\220Q\220e\2301\330\014\022\220%\220q\230\005\230Q\330\010\017\210t\2203\220a"; -static const char __pyx_k_55H_a_a_q_a_J_c_T_y_1_1A_1_waq[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\022\220$\220a\330\010\017\210q\330\010\022\220!\330\010\026\220a\330\010\014\210J\320\026&\240c\250\021\250+\260T\270\021\330\014\017\210y\230\003\2301\330\020\030\230\013\2401\240A\340\020\032\230!\330\020\023\2201\330\024\037\230w\240a\240q\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\014\210D\220\010\230\003\2303\230a\230}\250C\250s\260$\260e\2702\270Q\330\014\023\2201\330\010\013\2101\330\014\020\220\014\230A\330\020\023\2209\230G\240<\250u\260I\270W\300L\320PS\320SV\320VW\320Wd\320dg\320gh\330\024\035\230W\240A\240Q\330\024\030\230\t\240\026\240q\330\030\033\2305\240\002\240&\250\002\250!\330\034\"\240*\250A\250Q\330\024\027\220t\2301\330\030\037\230q\330\010\017\210q"; -static const char __pyx_k_55H_a_d_Q_a_1_1Kq_9Cq_az_1_z_q[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\026\220d\230!\330\010\021\220\024\220Q\330\010\016\210a\330\010\013\2101\330\014\020\220\n\230.\250\003\2501\250K\260q\330\020\023\2209\230C\230q\330\024\033\230;\240a\240z\260\022\2601\330\014\017\210z\230\021\230%\230q\330\020\026\220e\2301\230E\240\021\330\014\017\210t\2202\220Q\330\020\027\220q\330\014\017\210q\330\020\024\220J\230n\250C\250q\260\013\2701\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230t\2402\240V\2502\250[\270\002\270!\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\340\014\020\220\014\230A\330\020\023\2209\230C\230q\330\024\033\230;\240a\240q\330\014\017\210z\230\021\230%\230q\330\020\026\220e\2301\230E\240\021\330\014\017\210t\2202\220Q\330\020\027\220q\330\014\017\210q\330\020\024\220L\240\001\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230t\2402\240V\2502\250Q\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\330\010\017\210q"; -static const char __pyx_k_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\360\006\000\t\r\320\0146\260a\330\010\034\230A\330\010\014\210L\230\001\330\014\036\230g\240Q\330\014\020\320\020'\240w\250a\250q\330\010\014\210J\320\026&\240c\250\021\250+\260T\270\021\330\014\017\210}\230C\230q\330\020\023\320\023%\240W\250A\340\024\025\330\020$\240A\360\006\000\t\025\220D\230\001\330\010\014\210L\230\001\330\014\017\320\017!\240\027\250\005\250T\3201C\3003\300a\330\020\021\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\022\2301\330\024\032\230'\240\021\240!\330\025\033\2303\230b\240\004\240J\250c\260\021\330\024\032\230'\240\021\240!"; -static const char __pyx_k_77JJeef_QfKy_Q_WAT_1A_G4q_T_Qi[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\330\010\025\220W\230A\230T\240\021\330\010\020\220\003\2201\220A\340\010\014\210G\2204\220q\330\014\030\230\r\240T\320)=\270Q\270i\300|\320ST\330\014\022\220'\230\021\230!\330\014\020\220\007\220s\230!\330\020!\240\021\240$\240b\250\014\260D\270\002\270!\330\020\023\2203\220a\320\027'\240r\250\021\330\024\027\220w\230a\230q"; -static const char __pyx_k_77JJeef_QfKy_Q_d_4q_t1_S_A_IV1[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\340\010\026\220d\230!\340\010\013\2104\210q\330\014\020\220\007\220t\2301\330\020\031\230\027\240\001\240\021\330\020\035\230S\240\004\240A\330\020\024\220I\230V\2401\330\024\027\220v\230R\230{\250\"\250C\250q\260\007\260q\270\004\270A\330\030\036\230g\240Q\240a"; -static const char __pyx_k_ExactProdConstraint_preProcess[] = "ExactProdConstraint.preProcess"; -static const char __pyx_k_55H_a_4_7_1_4q_1_G4q_t3a_Kq_waq[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\013\2104\210|\2307\240!\330\014\023\2201\340\010\027\220{\240!\2404\240q\330\010\033\2301\330\010\032\230!\340\010\014\210G\2204\220q\330\014\017\210t\2203\220a\330\020$\240K\250q\260\001\340\020\037\230w\240a\240q\340\010\013\210:\220Q\320\026(\250\001\330\014\037\230u\240A\320%7\260q\340\010\013\2104\210q\330\014\023\320\023$\240C\240q\360\006\000\t\031\230\002\230#\230Q\230g\240Q\240e\2503\250a\250w\260a\260u\270D\300\005\300Q\330\010\025\220Q\220d\230.\250\001\250\023\250D\260\005\260W\270B\270b\300\004\300D\310\004\310D\320PV\320VW\330\010\027\220s\320\032,\250A\330\010\027\220s\320\032,\250A\340\010\013\210=\230\002\230-\240s\250-\260r\270\021\330\014\023\2201\340\010\013\2101\330\014\020\220\007\220q\330\020\031\230\021\230\"\230D\240\005\320%5\260S\270\002\270#\270Q\330\020 \240\002\240#\240Q\240g\250Q\250e\2603\260a\260w\270a\270u\300D\310\005\310X\320UX\320XZ\320Z]\320]^\330\020!\240\021\240$\240n\260A\260S\270\004\270E\300\027\310\002\310\"\310D\320PT\320TX\320X\\\320\\b\320bc\340\020\031\230\027\240\001\240\021\330\020\024\220I\230V\2401\330\024!\240\021\320\"3\2602\260V\2702\270R\270t\3005\310\001\330\024\035\230Q\330\030\036\230j\250\001\250\021\330\020\023\2204\220q\330\024\033\2301\340\010\017\210q"; -static const char __pyx_k_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\026\220d\230!\340\010\013\2104\210|\2307\240!\330\014\023\2201\340\010\027\220{\240!\2404\240q\330\010\024\220A\330\010\022\220!\340\010\013\2101\330\014\020\220\005\220^\2403\240a\240t\250;\260a\330\020\023\2204\220s\230!\330\024!\240\033\250A\250U\260\"\260A\340\024\036\230a\340\014\020\220\007\220t\2301\330\020\023\2204\220s\230!\330\024!\240\033\250A\250Q\340\024!\240\023\240A\240W\250A\250Q\330\024\036\230a\340\010\013\210:\220Q\220k\240\021\330\014\030\230\005\230Q\230k\250\021\340\010\013\2101\340\014\017\210z\230\022\2301\330\020\027\220q\330\014\017\210q\330\020\024\220G\2304\230q\330\024\027\220t\2307\240!\330\030!\240\027\250\001\250\021\330\030\033\2301\330\034 \240\t\250\026\250q\330 +\250:\260S\270\006\270b\300\013\3101\310D\320PY\320Y_\320_`\320`a\330 #\2409\250B\250a\330$*\250*\260A\260Q\340\034 \240\t\250\026\250q\330 +\250:\260R\260q\330 #\2409\250B\250a\330$*\250*\260A\260Q\330\030\033\2304\230q\330\034#\2401\330\014\023\2201\340\014\023\220:\230S\240\001"; -static const char __pyx_k_55H_a_d_4q_a_1_1Kq_9Cq_az_1_a_z[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\026\220d\230!\330\010\023\2204\220q\330\010\016\210a\330\010\022\220!\330\010\013\2101\330\014\020\220\n\230.\250\003\2501\250K\260q\330\020\023\2209\230C\230q\330\024\033\230;\240a\240z\260\022\2601\340\024\036\230a\330\014\017\210z\230\021\230%\230q\330\020\026\220e\2301\230E\240\021\330\014\017\210t\2202\220Q\330\020\027\220q\330\014\017\210}\230D\240\001\330\020\024\220J\230n\250C\250q\260\013\2701\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230t\2402\240V\2502\250[\270\002\270!\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\340\014\020\220\014\230A\330\020\023\2209\230C\230q\330\024\033\230;\240a\240q\340\024\036\230a\330\014\017\210z\230\021\230%\230q\330\020\026\220e\2301\230E\240\021\330\014\017\210t\2202\220Q\330\020\027\220q\330\014\017\210}\230D\240\001\330\020\024\220L\240\001\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230t\2402\240V\2502\250Q\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\330\010\013\2101\330\014\023\2204\220s\230!\340\014\023\2204\220s\230!"; -static const char __pyx_k_55H_a_d_L_y_1_AZs_1_1_t1_5_c_WH[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\016\210d\220!\330\010\022\220!\330\010\020\220\001\330\010\014\210L\230\001\330\014\017\210y\230\003\2301\330\020\031\230\033\240A\240Z\250s\260!\340\020\033\2301\330\010\013\2101\330\014\017\210t\2201\330\020\023\2205\230\006\230c\240\024\240W\250H\260B\260a\330\024\033\2301\340\020\023\2204\220t\2302\230X\240R\240q\330\024\033\2301\330\014\017\210}\230D\240\004\240D\250\002\250&\260\003\2601\360\006\000\021\025\220L\240\001\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230v\240W\250A\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\340\014\017\210t\2201\330\020\023\2206\230\023\230D\240\001\330\024\033\2301\340\020\023\2206\230\022\2304\230q\330\024\033\2301\330\010\017\210q"; -static const char __pyx_k_55H_a_d_L_y_1_AZwa_1_1_t1_5_c_W[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\016\210d\220!\330\010\022\220!\330\010\020\220\001\330\010\014\210L\230\001\330\014\017\210y\230\003\2301\330\020\031\230\033\240A\240Z\250w\260a\340\020\033\2301\330\010\013\2101\330\014\017\210t\2201\330\020\023\2205\230\006\230c\240\024\240W\250H\260B\260a\330\024\033\2301\340\020\023\2204\220t\2302\230X\240R\240q\330\024\033\2301\330\014\017\210}\230D\240\004\240D\250\002\250&\260\003\2601\360\006\000\021\025\220L\240\001\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230v\240S\250\001\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\340\014\017\210t\2201\330\020\023\2206\230\023\230D\240\001\330\024\033\2301\340\020\023\2206\230\022\2304\230q\330\024\033\2301\330\010\017\210q"; -static const char __pyx_k_77JJeef_3a_Q_y_WAQ_q_4t1Kz_1_wb[] = "\320\004$\320$7\3207J\320Je\320ef\360&\000\t\014\2103\210a\210{\230#\230Q\330\014\027\220y\240\001\240\021\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2204\220t\2301\230K\240z\260\032\2701\330\024\032\230'\240\021\240!\330\014\027\220w\230b\240\006\240a\330\014\030\230\001\230\031\240'\250\022\2506\260\021"; -static const char __pyx_k_77JJeef_QfKy_Q_6Q_L_7_gQa_q_d_Q[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\360\006\000\t6\260Q\330\010!\240\021\330\010\014\210L\230\001\330\014#\2407\250!\330\014&\240g\250Q\250a\330\014\017\210q\330\020\023\320\023*\250'\260\021\340\024\025\330\020)\250\021\360\006\000\t\027\220d\230!\330\010\021\220\024\220Q\330\010\013\2101\330\014\020\220\n\230.\250\003\2501\250K\260q\330\020\023\320\023*\250'\260\025\260d\320:Q\320QT\320TU\330\024\025\330\020\031\230\027\240\001\240\021\330\020\024\220I\230V\2401\330\024\027\220v\230R\230{\250\"\250A\330\030\036\230g\240Q\240a\340\014\020\220\014\230A\330\020\023\320\023*\250'\260\025\260d\320:Q\320QT\320TU\330\024\025\330\020\031\230\027\240\001\240\021\330\020\024\220I\230V\2401\330\024\027\220v\230R\230q\330\030\036\230g\240Q\240a"; -static const char __pyx_k_77JJeef_QfKy_Q_a_L_WAQ_q_6_Bd_A[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\360\006\000\t\023\220$\220a\330\010\014\210L\230\001\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\023\230B\230d\240(\250\"\250A\330\024\032\230'\240\021\240!"; -static const char __pyx_k_77JJeef_QfKy_Q_d_1_3at_a_IV1_vR[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\340\010\026\220d\230!\340\010\013\2101\330\014\020\220\005\220^\2403\240a\240t\250;\260a\330\020\031\230\027\240\001\240\021\330\020\024\220I\230V\2401\330\024\027\220v\230R\230{\250\"\250C\250q\260\007\260q\270\004\270A\330\030\036\230g\240Q\240a\340\014\020\220\007\220t\2301\330\020\031\230\027\240\001\240\021\330\020\035\230S\240\004\240A\330\020\035\230S\240\004\240A\330\020\024\220I\230V\2401\330\024\027\220v\230R\230{\250\"\250C\250q\260\007\260q\270\004\270A\330\030\036\230g\240Q\240a\330\024\027\220v\230R\230{\250\"\250C\250q\260\007\260q\270\004\270A\330\030\036\230g\240Q\240a"; -static const char __pyx_k_77JJeef_QfKy_Q_d_4q_1_1Kq_IV1_v[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\330\010\026\220d\230!\330\010\023\2204\220q\330\010\013\2101\330\014\020\220\n\230.\250\003\2501\250K\260q\330\020\031\230\027\240\001\240\021\330\020\024\220I\230V\2401\330\024\027\220v\230R\230{\250\"\250A\330\030\036\230g\240Q\240a\340\014\020\220\014\230A\330\020\031\230\027\240\001\240\021\330\020\024\220I\230V\2401\330\024\027\220v\230R\230q\330\030\036\230g\240Q\240a"; -static const char __pyx_k_77JJeef_QfKy_Q_q_A_S_S_G4q_4_1I[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\340\010\030\230\007\230q\240\004\240A\330\010\025\220S\230\001\230\021\330\010\025\220S\230\001\230\021\330\010\014\210G\2204\220q\330\014\027\220|\2404\320';\2701\270I\300\\\320QR\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\035\230Q\230f\240B\240k\260\026\260r\270\021\330\020\030\230\t\240\023\240A\240]\260#\260Q\260a\330\020\023\2207\230\"\230K\240s\250'\260\022\2601\330\024\032\230'\240\021\240!"; -static const char __pyx_k_99LL___Q_L_y_q_c_1_q_1_4t1Ky_AQ[] = "\320\004&\320&9\3209L\320L^\320^_\360$\000\t\036\230Q\330\010\014\210L\230\001\330\014\017\210y\230\007\230q\330\020\023\320\023&\240c\250\021\330\024)\250\021\340\024\025\340\014\017\320\017\"\240'\250\021\360\006\000\021\032\230\027\240\001\240\021\330\020\023\2201\330\024\030\230\t\240\026\240q\330\030#\2401\320$:\270!\330\030\033\2304\230t\2401\240K\250y\270\001\330\034\"\240*\250A\250Q\330\024\030\230\013\2401\240A\330\020\023\2204\220q\330\024\033\2301\330\010\017\210q"; -static const char __pyx_k_A_a_L_Kt1Ja_3a_a_wl_fCq_q_L_q_A[] = "\200A\340\023\024\330\021\022\330\025\026\330\010\t\330\024\025\340\010\026\220a\330\010\014\210L\230\001\330\014\024\220K\230t\2401\240J\250a\330\014\017\210|\2303\230a\330\020\036\230a\330\021\027\220w\230l\250$\250f\260C\260q\330\020\027\220q\330\010\013\210=\230\004\230L\250\007\250q\330\014\020\220\014\230A\330\020\023\2209\230G\2401\330\024\035\230W\240A\240Q\330\024\027\220|\2407\250!\330\030\037\230q\330\024\030\230\t\240\026\240q\330\030\033\2306\240\023\240A\330\034\"\240*\250A\250Q\330\010\017\210q"; -static const char __pyx_k_Last_multiplier_must_be_1_as_it[] = "Last multiplier must be 1, as it is the target variable."; -static const char __pyx_k_VariableMaxProdConstraint__safe[] = "VariableMaxProdConstraint._safe_product"; -static const char __pyx_k_VariableMaxSumConstraint___call[] = "VariableMaxSumConstraint.__call__"; -static const char __pyx_k_VariableMaxSumConstraint___init[] = "VariableMaxSumConstraint.__init__..genexpr"; -static const char __pyx_k_VariableMinProdConstraint__safe[] = "VariableMinProdConstraint._safe_product"; -static const char __pyx_k_VariableMinSumConstraint___call[] = "VariableMinSumConstraint.__call__"; -static const char __pyx_k_VariableMinSumConstraint___init[] = "VariableMinSumConstraint.__init__..genexpr"; -static const char __pyx_k_q_G4q_t3a_Qa_t1_3avS_4q_3a_Qb_E[] = "\320\004/\250q\330\010\021\220\021\330\010\014\210G\2204\220q\330\014\017\210t\2203\220a\330\020\021\330\014\022\220+\230Q\230a\330\014\017\210t\2201\330\020\021\330\014\022\220'\230\022\2303\230a\230v\240S\250\001\250\021\340\010\013\2104\210q\330\014\023\2203\220a\360\006\000\t\026\220Q\220b\230\004\230E\240\027\250\002\250\"\250D\260\004\260D\270\004\270F\300!\330\010\023\2201\220D\230\016\240a\240s\250$\250e\2601\330\010\017\210s\220!\220;\230c\240\021\240!"; -static const char __pyx_k_q_G4q_t3a_Qa_t1_3avS_Qb_E_4q_3a[] = "\320\004/\250q\340\010\021\220\021\330\010\014\210G\2204\220q\330\014\017\210t\2203\220a\330\020\021\330\014\022\220+\230Q\230a\330\014\017\210t\2201\330\020\021\330\014\022\220'\230\022\2303\230a\230v\240S\250\001\250\021\340\010\025\220Q\220b\230\004\230E\240\021\330\010\013\2104\210q\330\014\023\2203\220a\360\006\000\t\026\220Q\220b\230\004\230E\240\027\250\002\250\"\250D\260\004\260D\270\004\270F\300!\330\010\023\2201\220D\230\016\240a\240s\250$\250e\2601\330\010\017\210s\220!\220;\230c\240\021\240!"; -static const char __pyx_k_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J_2[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\360\006\000\t\r\320\0146\260a\330\010\034\230A\330\010\014\210L\230\001\330\014\036\230g\240Q\330\014\020\320\020'\240w\250a\250q\330\010\014\210J\320\026&\240c\250\021\250+\260T\270\021\330\014\017\210}\230C\230q\330\020\023\320\023%\240W\250A\340\024\025\330\020$\240A\360\006\000\t\023\220$\220a\330\010\014\210L\230\001\330\014\017\320\017!\240\027\250\005\250T\3201C\3003\300a\330\020\021\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\022\2301\330\024\032\230'\240\021\240!\330\025\033\2303\230b\240\004\240H\250B\250a\330\024\032\230'\240\021\240!"; -static const char __pyx_k_A_A_E_r_A_WA_WAQ_1_82Q_D_3d_M_HC[] = "\200A\340\023\024\330\021\022\330\025\026\330\010\t\330\024\025\360>\000\t\025\220A\330\010\022\220!\330\010\014\210E\220\021\330\014\017\210r\220\023\220A\330\020\025\220W\230A\230[\250\001\250\021\340\020\025\220W\230A\230Q\330\020\033\2301\360\006\000\t\014\2108\2202\220Q\330\014\024\220D\230\013\2403\240d\250&\260\002\260(\270!\330\020\024\220M\240\023\240H\250C\250r\260\023\260D\270\r\300Q\300k\320QZ\320Z[\340\010\017\210t\2206\230\022\2301"; -static const char __pyx_k_A_q_L_Kt1Ja_vWA_6_A_1_AYa_1_A_9G[] = "\200A\340\023\024\330\021\022\330\025\026\330\010\t\330\024\025\340\010\017\210q\330\010\014\210L\230\001\330\014\024\220K\230t\2401\240J\250a\330\014\017\210v\220W\230A\330\020\023\2206\230\023\230A\330\024\033\2301\330\020\024\220A\220Y\230a\330\010\013\2101\330\014\020\220\014\230A\330\020\023\2209\230G\2401\330\024\035\230W\240A\240Q\330\024\030\230\t\240\021\330\030\033\2306\240\023\240A\330\034\"\240*\250A\250Q\330\034\037\230t\2401\330 '\240q\330\010\017\210q"; -static const char __pyx_k_Abstract_base_class_for_constrai[] = "Abstract base class for constraints."; -static const char __pyx_k_CompilableFunctionConstraint___c[] = "CompilableFunctionConstraint.__call__"; -static const char __pyx_k_CompilableFunctionConstraint___i[] = "CompilableFunctionConstraint.__init__"; -static const char __pyx_k_CompilableFunctionConstraint_can[] = "CompilableFunctionConstraint can not be called directly"; -static const char __pyx_k_Constraint_enforcing_that_at_lea[] = "Constraint enforcing that at least some of the values of given variables must be present in a given set.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(SomeInSetConstraint([1]))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1)], [('a', 1), ('b', 2)], [('a', 2), ('b', 1)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_the_pr[] = "Constraint enforcing that the product of variables equals the value of another variable.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\", \"c\"], [1, 2])\n >>> problem.addConstraint(VariableExactProdConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1), ('c', 1)], [('a', 1), ('b', 2), ('c', 2)], [('a', 2), ('b', 1), ('c', 2)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_the_su[] = "Constraint enforcing that the sum of variables equals the value of another variable.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\", \"c\"], [1, 2, 3])\n >>> problem.addConstraint(VariableExactSumConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1), ('c', 2)], [('a', 1), ('b', 2), ('c', 3)], [('a', 2), ('b', 1), ('c', 3)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_values[] = "Constraint enforcing that values of all given variables are different.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(AllDifferentConstraint())\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)]]\n "; -static const char __pyx_k_Constraint_which_wraps_a_functio[] = "Constraint which wraps a function defining the constraint logic.\n\n Examples:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> def func(a, b):\n ... return b > a\n >>> problem.addConstraint(func, [\"a\", \"b\"])\n >>> problem.getSolution()\n {'a': 1, 'b': 2}\n\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> def func(a, b):\n ... return b > a\n >>> problem.addConstraint(FunctionConstraint(func), [\"a\", \"b\"])\n >>> problem.getSolution()\n {'a': 1, 'b': 2}\n "; -static const char __pyx_k_ExactProdConstraint_preProcess_l[] = "ExactProdConstraint.preProcess..genexpr"; -static const char __pyx_k_MaxProdConstraint_preProcess_loc[] = "MaxProdConstraint.preProcess..genexpr"; -static const char __pyx_k_MaxSumConstraint_preProcess_loca[] = "MaxSumConstraint.preProcess..genexpr"; static const char __pyx_k_Module_containing_the_code_for_c[] = "Module containing the code for constraint definitions."; -static const char __pyx_k_Multipliers_must_match_sum_varia[] = "Multipliers must match sum variables and +1 for target."; -static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; -static const char __pyx_k_VariableExactProdConstraint___ca[] = "VariableExactProdConstraint.__call__..genexpr"; -static const char __pyx_k_VariableExactProdConstraint___in[] = "VariableExactProdConstraint.__init__"; -static const char __pyx_k_VariableExactProdConstraint__get[] = "VariableExactProdConstraint._get_product_bounds"; -static const char __pyx_k_VariableExactProdConstraint__saf[] = "VariableExactProdConstraint._safe_product"; -static const char __pyx_k_VariableExactProdConstraint_preP[] = "VariableExactProdConstraint.preProcess"; -static const char __pyx_k_VariableExactSumConstraint___cal[] = "VariableExactSumConstraint.__call__"; -static const char __pyx_k_VariableExactSumConstraint___ini[] = "VariableExactSumConstraint.__init__..genexpr"; -static const char __pyx_k_VariableExactSumConstraint_prePr[] = "VariableExactSumConstraint.preProcess..genexpr"; -static const char __pyx_k_VariableMaxProdConstraint___call[] = "VariableMaxProdConstraint.__call__..genexpr"; -static const char __pyx_k_VariableMaxProdConstraint___init[] = "VariableMaxProdConstraint.__init__"; -static const char __pyx_k_VariableMaxProdConstraint__get_p[] = "VariableMaxProdConstraint._get_product_bounds"; -static const char __pyx_k_VariableMaxProdConstraint_prePro[] = "VariableMaxProdConstraint.preProcess"; -static const char __pyx_k_VariableMaxSumConstraint_preProc[] = "VariableMaxSumConstraint.preProcess..genexpr"; -static const char __pyx_k_VariableMinProdConstraint___call[] = "VariableMinProdConstraint.__call__..genexpr"; -static const char __pyx_k_VariableMinProdConstraint___init[] = "VariableMinProdConstraint.__init__"; -static const char __pyx_k_VariableMinProdConstraint__get_p[] = "VariableMinProdConstraint._get_product_bounds"; -static const char __pyx_k_VariableMinProdConstraint_prePro[] = "VariableMinProdConstraint.preProcess"; -static const char __pyx_k_VariableMinSumConstraint_preProc[] = "VariableMinSumConstraint.preProcess..genexpr"; -static const char __pyx_k_Wrapper_function_for_picklable_s[] = "Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on."; -static const char __pyx_k_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A_2[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\026\220d\230!\340\010\013\2104\210|\2307\240!\330\014\023\2201\340\010\027\220{\240!\2404\240q\330\010\024\220A\340\010\013\2101\330\014\020\220\005\220^\2403\240a\240t\250;\260a\330\020\023\2204\220s\230!\330\024!\240\033\250A\250U\260\"\260A\340\024!\240\023\240A\240W\250A\250U\260\"\260A\340\014\020\220\007\220t\2301\330\020\023\2204\220s\230!\330\024!\240\033\250A\250Q\340\024!\240\023\240A\240W\250A\250Q\340\010\013\210:\220Q\220k\240\021\330\014\030\230\005\230Q\230k\250\021\340\010\017\210z\230\023\230A"; -static const char __pyx_k_VariableMaxSumConstraint___init_2[] = "VariableMaxSumConstraint.__init__"; -static const char __pyx_k_VariableMinSumConstraint___init_2[] = "VariableMinSumConstraint.__init__"; -static const char __pyx_k_Constraint_enforcing_that_at_lea_2[] = "Constraint enforcing that at least some of the values of given variables must not be present in a given set.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(SomeNotInSetConstraint([1]))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)], [('a', 2), ('b', 2)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_the_pr_2[] = "Constraint enforcing that the product of variables is at least the value of another variable.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\", \"c\"], [-1, 2])\n >>> problem.addConstraint(VariableMinProdConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -1), ('b', -1), ('c', -1)], [('a', 2), ('b', 2), ('c', -1)], [('a', 2), ('b', 2), ('c', 2)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_the_pr_3[] = "Constraint enforcing that the product of variables is at most the value of another variable.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\", \"c\"], [-1, 2])\n >>> problem.addConstraint(VariableMaxProdConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -1), ('b', -1), ('c', 2)], [('a', -1), ('b', 2), ('c', -1)], [('a', -1), ('b', 2), ('c', 2)], [('a', 2), ('b', -1), ('c', -1)], [('a', 2), ('b', -1), ('c', 2)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_the_su_2[] = "Constraint enforcing that the sum of variables sum at least to the value of another variable.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\", \"c\"], [1, 4])\n >>> problem.addConstraint(VariableMinSumConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1), ('c', 1)], [('a', 1), ('b', 4), ('c', 1)], [('a', 1), ('b', 4), ('c', 4)], [('a', 4), ('b', 1), ('c', 1)], [('a', 4), ('b', 1), ('c', 4)], [('a', 4), ('b', 4), ('c', 1)], [('a', 4), ('b', 4), ('c', 4)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_the_su_3[] = "Constraint enforcing that the sum of variables sum at most to the value of another variable.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\", \"c\"], [1, 3, 4])\n >>> problem.addConstraint(VariableMaxSumConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1), ('c', 3)], [('a', 1), ('b', 1), ('c', 4)], [('a', 1), ('b', 3), ('c', 4)], [('a', 3), ('b', 1), ('c', 4)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_values_2[] = "Constraint enforcing that values of all given variables are equal.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(AllEqualConstraint())\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1)], [('a', 2), ('b', 2)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_values_3[] = "Constraint enforcing that values of given variables sum exactly to a given amount.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(ExactSumConstraint(3))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_values_4[] = "Constraint enforcing that values of given variables sum at least to a given amount.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(MinSumConstraint(3))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)], [('a', 2), ('b', 2)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_values_5[] = "Constraint enforcing that values of given variables sum up to a given amount.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(MaxSumConstraint(3))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1)], [('a', 1), ('b', 2)], [('a', 2), ('b', 1)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_values_6[] = "Constraint enforcing that values of given variables create a product of exactly a given amount.\n \n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(ExactProdConstraint(2))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_values_7[] = "Constraint enforcing that values of given variables create a product up to at least a given amount.\n \n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(MinProdConstraint(2))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)], [('a', 2), ('b', 2)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_values_8[] = "Constraint enforcing that values of given variables create a product up to at most a given amount.\n \n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(MaxProdConstraint(2))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1)], [('a', 1), ('b', 2)], [('a', 2), ('b', 1)]]\n "; -static const char __pyx_k_Constraint_enforcing_that_values_9[] = "Constraint enforcing that values of given variables are present in the given set.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(InSetConstraint([1]))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1)]]\n "; -static const char __pyx_k_VariableExactProdConstraint___ca_2[] = "VariableExactProdConstraint.__call__"; -static const char __pyx_k_VariableExactSumConstraint___ini_2[] = "VariableExactSumConstraint.__init__"; -static const char __pyx_k_VariableExactSumConstraint_prePr_2[] = "VariableExactSumConstraint.preProcess"; -static const char __pyx_k_VariableMaxProdConstraint___call_2[] = "VariableMaxProdConstraint.__call__"; -static const char __pyx_k_VariableMaxSumConstraint_preProc_2[] = "VariableMaxSumConstraint.preProcess"; -static const char __pyx_k_VariableMinProdConstraint___call_2[] = "VariableMinProdConstraint.__call__"; -static const char __pyx_k_VariableMinSumConstraint_preProc_2[] = "VariableMinSumConstraint.preProcess"; -static const char __pyx_k_Constraint_enforcing_that_values_10[] = "Constraint enforcing that values of given variables are not present in the given set.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(NotInSetConstraint([1]))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 2), ('b', 2)]]\n "; /* #### Code section: decls ### */ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_variables, CYTHON_UNUSED PyObject *__pyx_v_domains, CYTHON_UNUSED PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints); /* proto */ -static PyObject *__pyx_pf_10constraint_11constraints___defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v__unassigned); /* proto */ -static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_assigned); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck, PyObject *__pyx_v__unassigned); /* proto */ -static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_assigned); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v__unassigned); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func, int __pyx_v_assigned); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstraint_2__call__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_variables, CYTHON_UNUSED PyObject *__pyx_v_domains, CYTHON_UNUSED PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck, CYTHON_UNUSED PyObject *__pyx_v__unassigned); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck, PyObject *__pyx_v__unassigned); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func, int __pyx_v_assigned); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___call__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck, PyObject *__pyx_v__unassigned); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstraint_2__call__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_variables, CYTHON_UNUSED PyObject *__pyx_v_domains, CYTHON_UNUSED PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck, CYTHON_UNUSED PyObject *__pyx_v__unassigned); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___call__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck, PyObject *__pyx_v__unassigned); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck, PyObject *__pyx_v__unassigned); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_exactsum, PyObject *__pyx_v_multipliers); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints); /* proto */ @@ -3322,14 +3126,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_minsum, PyObject *__pyx_v_multipliers); /* proto */ -static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, CYTHON_UNUSED PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, CYTHON_UNUSED PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_8__init___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_target_var, PyObject *__pyx_v_sum_vars, PyObject *__pyx_v_multipliers); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_10preProcess_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_maxsum, PyObject *__pyx_v_multipliers); /* proto */ -static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_10preProcess_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_8__init___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ @@ -3340,6 +3144,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_exactprod); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_10preProcess_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_8__call___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_target_var, PyObject *__pyx_v_product_vars); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_2_get_product_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_domain_dict, PyObject *__pyx_v_exclude_var); /* proto */ @@ -3347,8 +3152,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_6preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___6genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_minprod); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, CYTHON_UNUSED PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck); /* proto */ @@ -3361,6 +3165,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_maxprod); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_10preProcess_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_8__call___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_target_var, PyObject *__pyx_v_product_vars); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_2_get_product_bounds(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_domain_dict, PyObject *__pyx_v_exclude_var); /* proto */ @@ -3378,6 +3183,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set, PyObject *__pyx_v_n, PyObject *__pyx_v_exact); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_14sum_other_vars_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_10constraint_11constraints_sum_other_vars(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_variable, PyObject *__pyx_v_values); /* proto */ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_defaults(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_preProcess(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3387,19 +3194,21 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_ge static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_preProcess(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_preProcess(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_10_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12___call__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_15_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_16___call__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_15___call__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_16_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_18_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19___call__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_20_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_22_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ /* SmallCodeConfig */ @@ -3420,24 +3229,6 @@ typedef struct { PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED - PyTypeObject *__pyx_CyFunctionType; - #endif - #ifdef __Pyx_FusedFunction_USED - PyTypeObject *__pyx_FusedFunctionType; - #endif - #ifdef __Pyx_Generator_USED - PyTypeObject *__pyx_GeneratorType; - #endif - #ifdef __Pyx_IterableCoroutine_USED - PyTypeObject *__pyx_IterableCoroutineType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineAwaitType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineType; - #endif PyObject *__pyx_type_10constraint_11constraints___pyx_defaults; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess; @@ -3447,19 +3238,21 @@ typedef struct { PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr; - PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr; - PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_8_preProcess; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_9_genexpr; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr; - PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr; - PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_16___call__; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_15___call__; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_19___call__; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars; + PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_22_genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_defaults; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess; @@ -3469,29 +3262,31 @@ typedef struct { PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr; - PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr; - PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr; - PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr; - PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars; + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values; __Pyx_CachedCFunction __pyx_umethod_PyList_Type__remove; PyObject *__pyx_slice[1]; - PyObject *__pyx_tuple[5]; - PyObject *__pyx_codeobj_tab[75]; - PyObject *__pyx_string_tab[288]; - PyObject *__pyx_int_0; - PyObject *__pyx_int_1; - PyObject *__pyx_int_10; + PyObject *__pyx_tuple[4]; + PyObject *__pyx_codeobj_tab[78]; + PyObject *__pyx_string_tab[349]; + PyObject *__pyx_number_tab[3]; /* #### Code section: module_state_contents ### */ #if CYTHON_USE_FREELISTS @@ -3535,13 +3330,13 @@ int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_7_genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_8_genexpr[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_8_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_8_preProcess[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_8_preProcess; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_9_preProcess[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_9_preProcess; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_9_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_9_genexpr; #endif #if CYTHON_USE_FREELISTS @@ -3570,13 +3365,13 @@ int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_14_genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_15_genexpr[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_15_genexpr; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_15___call__[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_15___call__; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_16___call__[8]; -int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_16___call__; +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_16_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_16_genexpr; #endif #if CYTHON_USE_FREELISTS @@ -3598,6 +3393,16 @@ int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_19___call__; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_20_genexpr[8]; int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_20_genexpr; #endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_22_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_22_genexpr; +#endif /* CommonTypesMetaclass.module_state_decls */ PyTypeObject *__pyx_CommonTypesMetaclassType; @@ -3606,6 +3411,9 @@ PyTypeObject *__pyx_CommonTypesMetaclassType; PyObject *__Pyx_CachedMethodType; #endif +/* CythonFunctionShared.module_state_decls */ +PyTypeObject *__pyx_CyFunctionType; + /* CodeObjectCache.module_state_decls */ struct __Pyx_CodeObjectCache __pyx_code_cache; @@ -3614,6 +3422,9 @@ struct __Pyx_CodeObjectCache __pyx_code_cache; PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; #endif +/* Generator.module_state_decls */ +PyTypeObject *__pyx_GeneratorType; + /* #### Code section: module_state_end ### */ } __pyx_mstatetype; @@ -3641,185 +3452,185 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati /* #### Code section: constant_name_defines ### */ #define __pyx_kp_u_ __pyx_string_tab[0] #define __pyx_kp_u_Abstract_base_class_for_constrai __pyx_string_tab[1] -#define __pyx_n_u_AllDifferentConstraint __pyx_string_tab[2] -#define __pyx_n_u_AllDifferentConstraint___call __pyx_string_tab[3] -#define __pyx_n_u_AllEqualConstraint __pyx_string_tab[4] -#define __pyx_n_u_AllEqualConstraint___call __pyx_string_tab[5] -#define __pyx_n_u_AssertionError __pyx_string_tab[6] -#define __pyx_n_u_Callable __pyx_string_tab[7] -#define __pyx_kp_u_Can_t_happen __pyx_string_tab[8] -#define __pyx_n_u_CompilableFunctionConstraint __pyx_string_tab[9] -#define __pyx_n_u_CompilableFunctionConstraint___c __pyx_string_tab[10] -#define __pyx_n_u_CompilableFunctionConstraint___i __pyx_string_tab[11] -#define __pyx_kp_u_CompilableFunctionConstraint_can __pyx_string_tab[12] -#define __pyx_n_u_Constraint __pyx_string_tab[13] -#define __pyx_n_u_Constraint___call __pyx_string_tab[14] -#define __pyx_kp_u_Constraint_enforcing_that_at_lea __pyx_string_tab[15] -#define __pyx_kp_u_Constraint_enforcing_that_at_lea_2 __pyx_string_tab[16] -#define __pyx_kp_u_Constraint_enforcing_that_the_pr __pyx_string_tab[17] -#define __pyx_kp_u_Constraint_enforcing_that_the_pr_2 __pyx_string_tab[18] -#define __pyx_kp_u_Constraint_enforcing_that_the_pr_3 __pyx_string_tab[19] -#define __pyx_kp_u_Constraint_enforcing_that_the_su __pyx_string_tab[20] -#define __pyx_kp_u_Constraint_enforcing_that_the_su_2 __pyx_string_tab[21] -#define __pyx_kp_u_Constraint_enforcing_that_the_su_3 __pyx_string_tab[22] -#define __pyx_kp_u_Constraint_enforcing_that_values __pyx_string_tab[23] -#define __pyx_kp_u_Constraint_enforcing_that_values_10 __pyx_string_tab[24] -#define __pyx_kp_u_Constraint_enforcing_that_values_2 __pyx_string_tab[25] -#define __pyx_kp_u_Constraint_enforcing_that_values_3 __pyx_string_tab[26] -#define __pyx_kp_u_Constraint_enforcing_that_values_4 __pyx_string_tab[27] -#define __pyx_kp_u_Constraint_enforcing_that_values_5 __pyx_string_tab[28] -#define __pyx_kp_u_Constraint_enforcing_that_values_6 __pyx_string_tab[29] -#define __pyx_kp_u_Constraint_enforcing_that_values_7 __pyx_string_tab[30] -#define __pyx_kp_u_Constraint_enforcing_that_values_8 __pyx_string_tab[31] -#define __pyx_kp_u_Constraint_enforcing_that_values_9 __pyx_string_tab[32] -#define __pyx_n_u_Constraint_forwardCheck __pyx_string_tab[33] -#define __pyx_n_u_Constraint_preProcess __pyx_string_tab[34] -#define __pyx_kp_u_Constraint_which_wraps_a_functio __pyx_string_tab[35] -#define __pyx_n_u_ExactProdConstraint __pyx_string_tab[36] -#define __pyx_n_u_ExactProdConstraint___call __pyx_string_tab[37] -#define __pyx_n_u_ExactProdConstraint___init __pyx_string_tab[38] -#define __pyx_n_u_ExactProdConstraint_preProcess __pyx_string_tab[39] -#define __pyx_n_u_ExactProdConstraint_preProcess_l __pyx_string_tab[40] -#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[41] -#define __pyx_n_u_ExactSumConstraint___call __pyx_string_tab[42] -#define __pyx_n_u_ExactSumConstraint___init __pyx_string_tab[43] -#define __pyx_n_u_ExactSumConstraint_preProcess __pyx_string_tab[44] -#define __pyx_n_u_FunctionConstraint __pyx_string_tab[45] -#define __pyx_n_u_FunctionConstraint___call __pyx_string_tab[46] -#define __pyx_n_u_FunctionConstraint___init __pyx_string_tab[47] -#define __pyx_n_u_InSetConstraint __pyx_string_tab[48] -#define __pyx_n_u_InSetConstraint___call __pyx_string_tab[49] -#define __pyx_n_u_InSetConstraint___init __pyx_string_tab[50] -#define __pyx_n_u_InSetConstraint_preProcess __pyx_string_tab[51] -#define __pyx_kp_u_Last_multiplier_must_be_1_as_it __pyx_string_tab[52] -#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[53] -#define __pyx_n_u_MaxProdConstraint___call __pyx_string_tab[54] -#define __pyx_n_u_MaxProdConstraint___init __pyx_string_tab[55] -#define __pyx_n_u_MaxProdConstraint_preProcess __pyx_string_tab[56] -#define __pyx_n_u_MaxProdConstraint_preProcess_loc __pyx_string_tab[57] -#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[58] -#define __pyx_n_u_MaxSumConstraint___call __pyx_string_tab[59] -#define __pyx_n_u_MaxSumConstraint___init __pyx_string_tab[60] -#define __pyx_n_u_MaxSumConstraint_preProcess __pyx_string_tab[61] -#define __pyx_n_u_MaxSumConstraint_preProcess_loca __pyx_string_tab[62] -#define __pyx_n_u_MinProdConstraint __pyx_string_tab[63] -#define __pyx_n_u_MinProdConstraint___call __pyx_string_tab[64] -#define __pyx_n_u_MinProdConstraint___init __pyx_string_tab[65] -#define __pyx_n_u_MinProdConstraint_preProcess __pyx_string_tab[66] -#define __pyx_n_u_MinSumConstraint __pyx_string_tab[67] -#define __pyx_n_u_MinSumConstraint___call __pyx_string_tab[68] -#define __pyx_n_u_MinSumConstraint___init __pyx_string_tab[69] -#define __pyx_kp_u_Multipliers_must_be_numbers __pyx_string_tab[70] -#define __pyx_kp_u_Multipliers_must_match_sum_varia __pyx_string_tab[71] -#define __pyx_n_u_NotImplementedError __pyx_string_tab[72] -#define __pyx_n_u_NotInSetConstraint __pyx_string_tab[73] -#define __pyx_n_u_NotInSetConstraint___call __pyx_string_tab[74] -#define __pyx_n_u_NotInSetConstraint___init __pyx_string_tab[75] -#define __pyx_n_u_NotInSetConstraint_preProcess __pyx_string_tab[76] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[77] -#define __pyx_n_u_Optional __pyx_string_tab[78] -#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[79] -#define __pyx_n_u_RuntimeError __pyx_string_tab[80] -#define __pyx_n_u_Sequence __pyx_string_tab[81] -#define __pyx_kp_u_Sequence_str __pyx_string_tab[82] -#define __pyx_n_u_SomeInSetConstraint __pyx_string_tab[83] -#define __pyx_n_u_SomeInSetConstraint___call __pyx_string_tab[84] -#define __pyx_n_u_SomeInSetConstraint___init __pyx_string_tab[85] -#define __pyx_n_u_SomeNotInSetConstraint __pyx_string_tab[86] -#define __pyx_n_u_SomeNotInSetConstraint___call __pyx_string_tab[87] -#define __pyx_n_u_SomeNotInSetConstraint___init __pyx_string_tab[88] -#define __pyx_n_u_Unassigned __pyx_string_tab[89] -#define __pyx_n_u_Union __pyx_string_tab[90] -#define __pyx_kp_u_Union_int_float __pyx_string_tab[91] -#define __pyx_n_u_VariableExactProdConstraint __pyx_string_tab[92] -#define __pyx_n_u_VariableExactProdConstraint___ca __pyx_string_tab[93] -#define __pyx_n_u_VariableExactProdConstraint___ca_2 __pyx_string_tab[94] -#define __pyx_n_u_VariableExactProdConstraint___in __pyx_string_tab[95] -#define __pyx_n_u_VariableExactProdConstraint__get __pyx_string_tab[96] -#define __pyx_n_u_VariableExactProdConstraint__saf __pyx_string_tab[97] -#define __pyx_n_u_VariableExactProdConstraint_preP __pyx_string_tab[98] -#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[99] -#define __pyx_n_u_VariableExactSumConstraint___cal __pyx_string_tab[100] -#define __pyx_n_u_VariableExactSumConstraint___ini __pyx_string_tab[101] -#define __pyx_n_u_VariableExactSumConstraint___ini_2 __pyx_string_tab[102] -#define __pyx_n_u_VariableExactSumConstraint_prePr __pyx_string_tab[103] -#define __pyx_n_u_VariableExactSumConstraint_prePr_2 __pyx_string_tab[104] -#define __pyx_n_u_VariableMaxProdConstraint __pyx_string_tab[105] -#define __pyx_n_u_VariableMaxProdConstraint___call __pyx_string_tab[106] -#define __pyx_n_u_VariableMaxProdConstraint___call_2 __pyx_string_tab[107] -#define __pyx_n_u_VariableMaxProdConstraint___init __pyx_string_tab[108] -#define __pyx_n_u_VariableMaxProdConstraint__get_p __pyx_string_tab[109] -#define __pyx_n_u_VariableMaxProdConstraint__safe __pyx_string_tab[110] -#define __pyx_n_u_VariableMaxProdConstraint_prePro __pyx_string_tab[111] -#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[112] -#define __pyx_n_u_VariableMaxSumConstraint___call __pyx_string_tab[113] -#define __pyx_n_u_VariableMaxSumConstraint___init __pyx_string_tab[114] -#define __pyx_n_u_VariableMaxSumConstraint___init_2 __pyx_string_tab[115] -#define __pyx_n_u_VariableMaxSumConstraint_preProc __pyx_string_tab[116] -#define __pyx_n_u_VariableMaxSumConstraint_preProc_2 __pyx_string_tab[117] -#define __pyx_n_u_VariableMinProdConstraint __pyx_string_tab[118] -#define __pyx_n_u_VariableMinProdConstraint___call __pyx_string_tab[119] -#define __pyx_n_u_VariableMinProdConstraint___call_2 __pyx_string_tab[120] -#define __pyx_n_u_VariableMinProdConstraint___init __pyx_string_tab[121] -#define __pyx_n_u_VariableMinProdConstraint__get_p __pyx_string_tab[122] -#define __pyx_n_u_VariableMinProdConstraint__safe __pyx_string_tab[123] -#define __pyx_n_u_VariableMinProdConstraint_prePro __pyx_string_tab[124] -#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[125] -#define __pyx_n_u_VariableMinSumConstraint___call __pyx_string_tab[126] -#define __pyx_n_u_VariableMinSumConstraint___init __pyx_string_tab[127] -#define __pyx_n_u_VariableMinSumConstraint___init_2 __pyx_string_tab[128] -#define __pyx_n_u_VariableMinSumConstraint_preProc __pyx_string_tab[129] -#define __pyx_n_u_VariableMinSumConstraint_preProc_2 __pyx_string_tab[130] -#define __pyx_kp_u_Wrapper_function_for_picklable_s __pyx_string_tab[131] -#define __pyx_kp_u__2 __pyx_string_tab[132] -#define __pyx_kp_u_add_note __pyx_string_tab[133] -#define __pyx_n_u_all_bounds __pyx_string_tab[134] -#define __pyx_n_u_append __pyx_string_tab[135] -#define __pyx_n_u_assigned __pyx_string_tab[136] -#define __pyx_n_u_assigned_2 __pyx_string_tab[137] -#define __pyx_n_u_assigned_prod __pyx_string_tab[138] -#define __pyx_n_u_assigned_product __pyx_string_tab[139] -#define __pyx_n_u_assignments __pyx_string_tab[140] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[141] -#define __pyx_n_u_b __pyx_string_tab[142] -#define __pyx_n_u_bool __pyx_string_tab[143] -#define __pyx_n_u_bounds __pyx_string_tab[144] -#define __pyx_n_u_c __pyx_string_tab[145] -#define __pyx_n_u_call __pyx_string_tab[146] -#define __pyx_n_u_candidates __pyx_string_tab[147] -#define __pyx_n_u_class_getitem __pyx_string_tab[148] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[149] -#define __pyx_n_u_close __pyx_string_tab[150] -#define __pyx_n_u_collections_abc __pyx_string_tab[151] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[152] -#define __pyx_kp_u_constraint_constraints_py __pyx_string_tab[153] -#define __pyx_n_u_constraint_domain __pyx_string_tab[154] -#define __pyx_n_u_constraints __pyx_string_tab[155] -#define __pyx_n_u_contains_lt1 __pyx_string_tab[156] -#define __pyx_n_u_contains_negative __pyx_string_tab[157] -#define __pyx_n_u_dict __pyx_string_tab[158] -#define __pyx_kp_u_disable __pyx_string_tab[159] -#define __pyx_n_u_doc __pyx_string_tab[160] -#define __pyx_n_u_dom __pyx_string_tab[161] -#define __pyx_n_u_domain __pyx_string_tab[162] -#define __pyx_n_u_domain_bounds __pyx_string_tab[163] -#define __pyx_n_u_domain_dict __pyx_string_tab[164] -#define __pyx_n_u_domains __pyx_string_tab[165] -#define __pyx_kp_u_enable __pyx_string_tab[166] -#define __pyx_n_u_exact __pyx_string_tab[167] -#define __pyx_n_u_exact_2 __pyx_string_tab[168] -#define __pyx_n_u_exactprod __pyx_string_tab[169] -#define __pyx_n_u_exactprod_2 __pyx_string_tab[170] -#define __pyx_n_u_exactsum __pyx_string_tab[171] -#define __pyx_n_u_exactsum_2 __pyx_string_tab[172] -#define __pyx_n_u_exclude_var __pyx_string_tab[173] -#define __pyx_n_u_forwardCheck __pyx_string_tab[174] -#define __pyx_n_u_forwardcheck __pyx_string_tab[175] -#define __pyx_n_u_found __pyx_string_tab[176] -#define __pyx_n_u_func __pyx_string_tab[177] -#define __pyx_n_u_func_2 __pyx_string_tab[178] -#define __pyx_n_u_func_3 __pyx_string_tab[179] -#define __pyx_kp_u_gc __pyx_string_tab[180] +#define __pyx_kp_u_Can_t_happen __pyx_string_tab[2] +#define __pyx_kp_u_CompilableFunctionConstraint_can __pyx_string_tab[3] +#define __pyx_kp_u_Constraint_enforcing_that_at_lea __pyx_string_tab[4] +#define __pyx_kp_u_Constraint_enforcing_that_at_lea_2 __pyx_string_tab[5] +#define __pyx_kp_u_Constraint_enforcing_that_the_pr __pyx_string_tab[6] +#define __pyx_kp_u_Constraint_enforcing_that_the_pr_2 __pyx_string_tab[7] +#define __pyx_kp_u_Constraint_enforcing_that_the_pr_3 __pyx_string_tab[8] +#define __pyx_kp_u_Constraint_enforcing_that_the_su __pyx_string_tab[9] +#define __pyx_kp_u_Constraint_enforcing_that_the_su_2 __pyx_string_tab[10] +#define __pyx_kp_u_Constraint_enforcing_that_the_su_3 __pyx_string_tab[11] +#define __pyx_kp_u_Constraint_enforcing_that_values __pyx_string_tab[12] +#define __pyx_kp_u_Constraint_enforcing_that_values_10 __pyx_string_tab[13] +#define __pyx_kp_u_Constraint_enforcing_that_values_2 __pyx_string_tab[14] +#define __pyx_kp_u_Constraint_enforcing_that_values_3 __pyx_string_tab[15] +#define __pyx_kp_u_Constraint_enforcing_that_values_4 __pyx_string_tab[16] +#define __pyx_kp_u_Constraint_enforcing_that_values_5 __pyx_string_tab[17] +#define __pyx_kp_u_Constraint_enforcing_that_values_6 __pyx_string_tab[18] +#define __pyx_kp_u_Constraint_enforcing_that_values_7 __pyx_string_tab[19] +#define __pyx_kp_u_Constraint_enforcing_that_values_8 __pyx_string_tab[20] +#define __pyx_kp_u_Constraint_enforcing_that_values_9 __pyx_string_tab[21] +#define __pyx_kp_u_Constraint_which_wraps_a_functio __pyx_string_tab[22] +#define __pyx_kp_u_Last_multiplier_must_be_1_as_it __pyx_string_tab[23] +#define __pyx_kp_u_Multipliers_must_be_numbers __pyx_string_tab[24] +#define __pyx_kp_u_Multipliers_must_match_sum_varia __pyx_string_tab[25] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[26] +#define __pyx_kp_u_Sequence_None __pyx_string_tab[27] +#define __pyx_kp_u_Sequence_str __pyx_string_tab[28] +#define __pyx_kp_u_Wrapper_function_for_picklable_s __pyx_string_tab[29] +#define __pyx_kp_u__2 __pyx_string_tab[30] +#define __pyx_kp_u_add_note __pyx_string_tab[31] +#define __pyx_kp_u_constraint_constraints_py __pyx_string_tab[32] +#define __pyx_kp_u_disable __pyx_string_tab[33] +#define __pyx_kp_u_enable __pyx_string_tab[34] +#define __pyx_kp_u_gc __pyx_string_tab[35] +#define __pyx_kp_u_int_float __pyx_string_tab[36] +#define __pyx_kp_u_isenabled __pyx_string_tab[37] +#define __pyx_kp_u_list_tuple __pyx_string_tab[38] +#define __pyx_n_u_AllDifferentConstraint __pyx_string_tab[39] +#define __pyx_n_u_AllDifferentConstraint___call __pyx_string_tab[40] +#define __pyx_n_u_AllEqualConstraint __pyx_string_tab[41] +#define __pyx_n_u_AllEqualConstraint___call __pyx_string_tab[42] +#define __pyx_n_u_Callable __pyx_string_tab[43] +#define __pyx_n_u_CompilableFunctionConstraint __pyx_string_tab[44] +#define __pyx_n_u_CompilableFunctionConstraint___c __pyx_string_tab[45] +#define __pyx_n_u_CompilableFunctionConstraint___i __pyx_string_tab[46] +#define __pyx_n_u_Constraint __pyx_string_tab[47] +#define __pyx_n_u_Constraint___call __pyx_string_tab[48] +#define __pyx_n_u_Constraint_forwardCheck __pyx_string_tab[49] +#define __pyx_n_u_Constraint_preProcess __pyx_string_tab[50] +#define __pyx_n_u_ExactProdConstraint __pyx_string_tab[51] +#define __pyx_n_u_ExactProdConstraint___call __pyx_string_tab[52] +#define __pyx_n_u_ExactProdConstraint___call___loc __pyx_string_tab[53] +#define __pyx_n_u_ExactProdConstraint___init __pyx_string_tab[54] +#define __pyx_n_u_ExactProdConstraint_preProcess __pyx_string_tab[55] +#define __pyx_n_u_ExactProdConstraint_preProcess_l __pyx_string_tab[56] +#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[57] +#define __pyx_n_u_ExactSumConstraint___call __pyx_string_tab[58] +#define __pyx_n_u_ExactSumConstraint___init __pyx_string_tab[59] +#define __pyx_n_u_ExactSumConstraint_preProcess __pyx_string_tab[60] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[61] +#define __pyx_n_u_FunctionConstraint___call __pyx_string_tab[62] +#define __pyx_n_u_FunctionConstraint___init __pyx_string_tab[63] +#define __pyx_n_u_InSetConstraint __pyx_string_tab[64] +#define __pyx_n_u_InSetConstraint___call __pyx_string_tab[65] +#define __pyx_n_u_InSetConstraint___init __pyx_string_tab[66] +#define __pyx_n_u_InSetConstraint_preProcess __pyx_string_tab[67] +#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[68] +#define __pyx_n_u_MaxProdConstraint___call __pyx_string_tab[69] +#define __pyx_n_u_MaxProdConstraint___call___local __pyx_string_tab[70] +#define __pyx_n_u_MaxProdConstraint___init __pyx_string_tab[71] +#define __pyx_n_u_MaxProdConstraint_preProcess __pyx_string_tab[72] +#define __pyx_n_u_MaxProdConstraint_preProcess_loc __pyx_string_tab[73] +#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[74] +#define __pyx_n_u_MaxSumConstraint___call __pyx_string_tab[75] +#define __pyx_n_u_MaxSumConstraint___init __pyx_string_tab[76] +#define __pyx_n_u_MaxSumConstraint_preProcess __pyx_string_tab[77] +#define __pyx_n_u_MinProdConstraint __pyx_string_tab[78] +#define __pyx_n_u_MinProdConstraint___call __pyx_string_tab[79] +#define __pyx_n_u_MinProdConstraint___init __pyx_string_tab[80] +#define __pyx_n_u_MinProdConstraint_preProcess __pyx_string_tab[81] +#define __pyx_n_u_MinSumConstraint __pyx_string_tab[82] +#define __pyx_n_u_MinSumConstraint___call __pyx_string_tab[83] +#define __pyx_n_u_MinSumConstraint___init __pyx_string_tab[84] +#define __pyx_n_u_MinSumConstraint_preProcess __pyx_string_tab[85] +#define __pyx_n_u_NotInSetConstraint __pyx_string_tab[86] +#define __pyx_n_u_NotInSetConstraint___call __pyx_string_tab[87] +#define __pyx_n_u_NotInSetConstraint___init __pyx_string_tab[88] +#define __pyx_n_u_NotInSetConstraint_preProcess __pyx_string_tab[89] +#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[90] +#define __pyx_n_u_Sequence __pyx_string_tab[91] +#define __pyx_n_u_SomeInSetConstraint __pyx_string_tab[92] +#define __pyx_n_u_SomeInSetConstraint___call __pyx_string_tab[93] +#define __pyx_n_u_SomeInSetConstraint___init __pyx_string_tab[94] +#define __pyx_n_u_SomeNotInSetConstraint __pyx_string_tab[95] +#define __pyx_n_u_SomeNotInSetConstraint___call __pyx_string_tab[96] +#define __pyx_n_u_SomeNotInSetConstraint___init __pyx_string_tab[97] +#define __pyx_n_u_Unassigned __pyx_string_tab[98] +#define __pyx_n_u_VariableExactProdConstraint __pyx_string_tab[99] +#define __pyx_n_u_VariableExactProdConstraint___ca __pyx_string_tab[100] +#define __pyx_n_u_VariableExactProdConstraint___ca_2 __pyx_string_tab[101] +#define __pyx_n_u_VariableExactProdConstraint___in __pyx_string_tab[102] +#define __pyx_n_u_VariableExactProdConstraint__get __pyx_string_tab[103] +#define __pyx_n_u_VariableExactProdConstraint__saf __pyx_string_tab[104] +#define __pyx_n_u_VariableExactProdConstraint_preP __pyx_string_tab[105] +#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[106] +#define __pyx_n_u_VariableExactSumConstraint___cal __pyx_string_tab[107] +#define __pyx_n_u_VariableExactSumConstraint___ini __pyx_string_tab[108] +#define __pyx_n_u_VariableExactSumConstraint___ini_2 __pyx_string_tab[109] +#define __pyx_n_u_VariableExactSumConstraint_prePr __pyx_string_tab[110] +#define __pyx_n_u_VariableExactSumConstraint_prePr_2 __pyx_string_tab[111] +#define __pyx_n_u_VariableMaxProdConstraint __pyx_string_tab[112] +#define __pyx_n_u_VariableMaxProdConstraint___call __pyx_string_tab[113] +#define __pyx_n_u_VariableMaxProdConstraint___call_2 __pyx_string_tab[114] +#define __pyx_n_u_VariableMaxProdConstraint___init __pyx_string_tab[115] +#define __pyx_n_u_VariableMaxProdConstraint__get_p __pyx_string_tab[116] +#define __pyx_n_u_VariableMaxProdConstraint__safe __pyx_string_tab[117] +#define __pyx_n_u_VariableMaxProdConstraint_prePro __pyx_string_tab[118] +#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[119] +#define __pyx_n_u_VariableMaxSumConstraint___call __pyx_string_tab[120] +#define __pyx_n_u_VariableMaxSumConstraint___init __pyx_string_tab[121] +#define __pyx_n_u_VariableMaxSumConstraint___init_2 __pyx_string_tab[122] +#define __pyx_n_u_VariableMaxSumConstraint_preProc __pyx_string_tab[123] +#define __pyx_n_u_VariableMaxSumConstraint_preProc_2 __pyx_string_tab[124] +#define __pyx_n_u_VariableMinProdConstraint __pyx_string_tab[125] +#define __pyx_n_u_VariableMinProdConstraint___call __pyx_string_tab[126] +#define __pyx_n_u_VariableMinProdConstraint___call_2 __pyx_string_tab[127] +#define __pyx_n_u_VariableMinProdConstraint___init __pyx_string_tab[128] +#define __pyx_n_u_VariableMinProdConstraint__get_p __pyx_string_tab[129] +#define __pyx_n_u_VariableMinProdConstraint__safe __pyx_string_tab[130] +#define __pyx_n_u_VariableMinProdConstraint_prePro __pyx_string_tab[131] +#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[132] +#define __pyx_n_u_VariableMinSumConstraint___call __pyx_string_tab[133] +#define __pyx_n_u_VariableMinSumConstraint___init __pyx_string_tab[134] +#define __pyx_n_u_VariableMinSumConstraint___init_2 __pyx_string_tab[135] +#define __pyx_n_u_VariableMinSumConstraint_preProc __pyx_string_tab[136] +#define __pyx_n_u_VariableMinSumConstraint_preProc_2 __pyx_string_tab[137] +#define __pyx_n_u_all_bounds __pyx_string_tab[138] +#define __pyx_n_u_annotate __pyx_string_tab[139] +#define __pyx_n_u_append __pyx_string_tab[140] +#define __pyx_n_u_assigned __pyx_string_tab[141] +#define __pyx_n_u_assigned_2 __pyx_string_tab[142] +#define __pyx_n_u_assigned_prod __pyx_string_tab[143] +#define __pyx_n_u_assigned_product __pyx_string_tab[144] +#define __pyx_n_u_assignments __pyx_string_tab[145] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[146] +#define __pyx_n_u_b __pyx_string_tab[147] +#define __pyx_n_u_bool __pyx_string_tab[148] +#define __pyx_n_u_bounds __pyx_string_tab[149] +#define __pyx_n_u_c __pyx_string_tab[150] +#define __pyx_n_u_call __pyx_string_tab[151] +#define __pyx_n_u_candidates __pyx_string_tab[152] +#define __pyx_n_u_class_getitem __pyx_string_tab[153] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[154] +#define __pyx_n_u_close __pyx_string_tab[155] +#define __pyx_n_u_collections_abc __pyx_string_tab[156] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[157] +#define __pyx_n_u_constraint_domain __pyx_string_tab[158] +#define __pyx_n_u_constraints __pyx_string_tab[159] +#define __pyx_n_u_contains_lt1 __pyx_string_tab[160] +#define __pyx_n_u_dict __pyx_string_tab[161] +#define __pyx_n_u_doc __pyx_string_tab[162] +#define __pyx_n_u_dom __pyx_string_tab[163] +#define __pyx_n_u_domain __pyx_string_tab[164] +#define __pyx_n_u_domain_bounds __pyx_string_tab[165] +#define __pyx_n_u_domain_dict __pyx_string_tab[166] +#define __pyx_n_u_domains __pyx_string_tab[167] +#define __pyx_n_u_exact __pyx_string_tab[168] +#define __pyx_n_u_exact_2 __pyx_string_tab[169] +#define __pyx_n_u_exactprod __pyx_string_tab[170] +#define __pyx_n_u_exactprod_2 __pyx_string_tab[171] +#define __pyx_n_u_exactsum __pyx_string_tab[172] +#define __pyx_n_u_exactsum_2 __pyx_string_tab[173] +#define __pyx_n_u_exclude_var __pyx_string_tab[174] +#define __pyx_n_u_forwardCheck __pyx_string_tab[175] +#define __pyx_n_u_forwardcheck __pyx_string_tab[176] +#define __pyx_n_u_found __pyx_string_tab[177] +#define __pyx_n_u_func __pyx_string_tab[178] +#define __pyx_n_u_func_2 __pyx_string_tab[179] +#define __pyx_n_u_func_3 __pyx_string_tab[180] #define __pyx_n_u_genexpr __pyx_string_tab[181] #define __pyx_n_u_get __pyx_string_tab[182] #define __pyx_n_u_get_product_bounds __pyx_string_tab[183] @@ -3828,14 +3639,14 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_index __pyx_string_tab[186] #define __pyx_n_u_init __pyx_string_tab[187] #define __pyx_n_u_is_coroutine __pyx_string_tab[188] -#define __pyx_kp_u_isenabled __pyx_string_tab[189] +#define __pyx_n_u_items __pyx_string_tab[189] #define __pyx_n_u_itertools __pyx_string_tab[190] -#define __pyx_kp_u_list_tuple __pyx_string_tab[191] -#define __pyx_n_u_lo __pyx_string_tab[192] -#define __pyx_n_u_m __pyx_string_tab[193] -#define __pyx_n_u_main __pyx_string_tab[194] -#define __pyx_n_u_max __pyx_string_tab[195] -#define __pyx_n_u_max_others __pyx_string_tab[196] +#define __pyx_n_u_lo __pyx_string_tab[191] +#define __pyx_n_u_m __pyx_string_tab[192] +#define __pyx_n_u_main __pyx_string_tab[193] +#define __pyx_n_u_max __pyx_string_tab[194] +#define __pyx_n_u_max_others __pyx_string_tab[195] +#define __pyx_n_u_max_sum_missing __pyx_string_tab[196] #define __pyx_n_u_maxprod __pyx_string_tab[197] #define __pyx_n_u_maxprod_2 __pyx_string_tab[198] #define __pyx_n_u_maxsum __pyx_string_tab[199] @@ -3844,89 +3655,153 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_metaclass __pyx_string_tab[202] #define __pyx_n_u_min __pyx_string_tab[203] #define __pyx_n_u_min_others __pyx_string_tab[204] -#define __pyx_n_u_minprod __pyx_string_tab[205] -#define __pyx_n_u_minprod_2 __pyx_string_tab[206] -#define __pyx_n_u_minsum __pyx_string_tab[207] -#define __pyx_n_u_minsum_2 __pyx_string_tab[208] -#define __pyx_n_u_minval __pyx_string_tab[209] -#define __pyx_n_u_missing __pyx_string_tab[210] -#define __pyx_n_u_missing_lt1 __pyx_string_tab[211] -#define __pyx_n_u_module __pyx_string_tab[212] -#define __pyx_n_u_mro_entries __pyx_string_tab[213] -#define __pyx_n_u_multiplier __pyx_string_tab[214] -#define __pyx_n_u_multipliers __pyx_string_tab[215] -#define __pyx_n_u_multipliers_2 __pyx_string_tab[216] -#define __pyx_n_u_n __pyx_string_tab[217] -#define __pyx_n_u_n_2 __pyx_string_tab[218] -#define __pyx_n_u_name __pyx_string_tab[219] -#define __pyx_n_u_next __pyx_string_tab[220] -#define __pyx_n_u_o __pyx_string_tab[221] -#define __pyx_n_u_other_max __pyx_string_tab[222] -#define __pyx_n_u_other_min __pyx_string_tab[223] -#define __pyx_n_u_other_products __pyx_string_tab[224] -#define __pyx_n_u_other_unassigned __pyx_string_tab[225] -#define __pyx_n_u_others __pyx_string_tab[226] -#define __pyx_n_u_others_bounds __pyx_string_tab[227] -#define __pyx_n_u_others_max __pyx_string_tab[228] -#define __pyx_n_u_others_min __pyx_string_tab[229] -#define __pyx_n_u_p __pyx_string_tab[230] -#define __pyx_n_u_parms __pyx_string_tab[231] -#define __pyx_n_u_pop __pyx_string_tab[232] -#define __pyx_n_u_possible_max __pyx_string_tab[233] -#define __pyx_n_u_possible_min __pyx_string_tab[234] -#define __pyx_n_u_possible_prods __pyx_string_tab[235] -#define __pyx_n_u_preProcess __pyx_string_tab[236] -#define __pyx_n_u_prepare __pyx_string_tab[237] -#define __pyx_n_u_prod __pyx_string_tab[238] -#define __pyx_n_u_prods __pyx_string_tab[239] -#define __pyx_n_u_product __pyx_string_tab[240] -#define __pyx_n_u_product_vars __pyx_string_tab[241] -#define __pyx_n_u_products __pyx_string_tab[242] -#define __pyx_n_u_qualname __pyx_string_tab[243] -#define __pyx_n_u_remove __pyx_string_tab[244] -#define __pyx_n_u_round __pyx_string_tab[245] -#define __pyx_n_u_safe_product __pyx_string_tab[246] -#define __pyx_n_u_seen __pyx_string_tab[247] -#define __pyx_n_u_self __pyx_string_tab[248] -#define __pyx_n_u_send __pyx_string_tab[249] -#define __pyx_n_u_set __pyx_string_tab[250] -#define __pyx_n_u_set_2 __pyx_string_tab[251] -#define __pyx_n_u_set_name __pyx_string_tab[252] -#define __pyx_n_u_singlevalue __pyx_string_tab[253] -#define __pyx_n_u_str __pyx_string_tab[254] -#define __pyx_n_u_sum __pyx_string_tab[255] -#define __pyx_n_u_sum_value __pyx_string_tab[256] -#define __pyx_n_u_sum_vars __pyx_string_tab[257] -#define __pyx_n_u_t_max __pyx_string_tab[258] -#define __pyx_n_u_t_min __pyx_string_tab[259] -#define __pyx_n_u_target_dom __pyx_string_tab[260] -#define __pyx_n_u_target_domain __pyx_string_tab[261] -#define __pyx_n_u_target_max __pyx_string_tab[262] -#define __pyx_n_u_target_min __pyx_string_tab[263] -#define __pyx_n_u_target_value __pyx_string_tab[264] -#define __pyx_n_u_target_var __pyx_string_tab[265] -#define __pyx_n_u_temp_sum __pyx_string_tab[266] -#define __pyx_n_u_test __pyx_string_tab[267] -#define __pyx_n_u_throw __pyx_string_tab[268] -#define __pyx_n_u_typing __pyx_string_tab[269] -#define __pyx_n_u_unassigned __pyx_string_tab[270] -#define __pyx_n_u_unassigned_2 __pyx_string_tab[271] -#define __pyx_n_u_unassigned_vars __pyx_string_tab[272] -#define __pyx_n_u_unassignedvariable __pyx_string_tab[273] -#define __pyx_n_u_v __pyx_string_tab[274] -#define __pyx_n_u_val __pyx_string_tab[275] -#define __pyx_n_u_value __pyx_string_tab[276] -#define __pyx_n_u_values __pyx_string_tab[277] -#define __pyx_n_u_var __pyx_string_tab[278] -#define __pyx_n_u_variable __pyx_string_tab[279] -#define __pyx_n_u_variable_contains_lt1 __pyx_string_tab[280] -#define __pyx_n_u_variable_contains_negative __pyx_string_tab[281] -#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[282] -#define __pyx_n_u_variable_with_negative __pyx_string_tab[283] -#define __pyx_n_u_variables __pyx_string_tab[284] -#define __pyx_n_u_vconstraints __pyx_string_tab[285] -#define __pyx_n_u_x __pyx_string_tab[286] -#define __pyx_n_u_zip __pyx_string_tab[287] +#define __pyx_n_u_min_sum_missing __pyx_string_tab[205] +#define __pyx_n_u_minprod __pyx_string_tab[206] +#define __pyx_n_u_minprod_2 __pyx_string_tab[207] +#define __pyx_n_u_minsum __pyx_string_tab[208] +#define __pyx_n_u_minsum_2 __pyx_string_tab[209] +#define __pyx_n_u_minval __pyx_string_tab[210] +#define __pyx_n_u_missing __pyx_string_tab[211] +#define __pyx_n_u_missing_lt1 __pyx_string_tab[212] +#define __pyx_n_u_missing_negative __pyx_string_tab[213] +#define __pyx_n_u_module __pyx_string_tab[214] +#define __pyx_n_u_mro_entries __pyx_string_tab[215] +#define __pyx_n_u_multiplier __pyx_string_tab[216] +#define __pyx_n_u_multipliers __pyx_string_tab[217] +#define __pyx_n_u_multipliers_2 __pyx_string_tab[218] +#define __pyx_n_u_n __pyx_string_tab[219] +#define __pyx_n_u_n_2 __pyx_string_tab[220] +#define __pyx_n_u_name __pyx_string_tab[221] +#define __pyx_n_u_next __pyx_string_tab[222] +#define __pyx_n_u_o __pyx_string_tab[223] +#define __pyx_n_u_other_max __pyx_string_tab[224] +#define __pyx_n_u_other_min __pyx_string_tab[225] +#define __pyx_n_u_other_products __pyx_string_tab[226] +#define __pyx_n_u_other_unassigned __pyx_string_tab[227] +#define __pyx_n_u_other_vars_max __pyx_string_tab[228] +#define __pyx_n_u_other_vars_min __pyx_string_tab[229] +#define __pyx_n_u_others_max __pyx_string_tab[230] +#define __pyx_n_u_others_min __pyx_string_tab[231] +#define __pyx_n_u_p __pyx_string_tab[232] +#define __pyx_n_u_parms __pyx_string_tab[233] +#define __pyx_n_u_pop __pyx_string_tab[234] +#define __pyx_n_u_possible_max __pyx_string_tab[235] +#define __pyx_n_u_possible_min __pyx_string_tab[236] +#define __pyx_n_u_possible_prods __pyx_string_tab[237] +#define __pyx_n_u_preProcess __pyx_string_tab[238] +#define __pyx_n_u_prepare __pyx_string_tab[239] +#define __pyx_n_u_prod __pyx_string_tab[240] +#define __pyx_n_u_prods __pyx_string_tab[241] +#define __pyx_n_u_product __pyx_string_tab[242] +#define __pyx_n_u_product_vars __pyx_string_tab[243] +#define __pyx_n_u_products __pyx_string_tab[244] +#define __pyx_n_u_qualname __pyx_string_tab[245] +#define __pyx_n_u_remove __pyx_string_tab[246] +#define __pyx_n_u_round __pyx_string_tab[247] +#define __pyx_n_u_safe_product __pyx_string_tab[248] +#define __pyx_n_u_seen __pyx_string_tab[249] +#define __pyx_n_u_self __pyx_string_tab[250] +#define __pyx_n_u_send __pyx_string_tab[251] +#define __pyx_n_u_set __pyx_string_tab[252] +#define __pyx_n_u_set_2 __pyx_string_tab[253] +#define __pyx_n_u_set_name __pyx_string_tab[254] +#define __pyx_n_u_setdefault __pyx_string_tab[255] +#define __pyx_n_u_singlevalue __pyx_string_tab[256] +#define __pyx_n_u_str __pyx_string_tab[257] +#define __pyx_n_u_sum __pyx_string_tab[258] +#define __pyx_n_u_sum_other_vars __pyx_string_tab[259] +#define __pyx_n_u_sum_other_vars_locals_genexpr __pyx_string_tab[260] +#define __pyx_n_u_sum_value __pyx_string_tab[261] +#define __pyx_n_u_sum_vars __pyx_string_tab[262] +#define __pyx_n_u_t_max __pyx_string_tab[263] +#define __pyx_n_u_t_min __pyx_string_tab[264] +#define __pyx_n_u_target_dom __pyx_string_tab[265] +#define __pyx_n_u_target_domain __pyx_string_tab[266] +#define __pyx_n_u_target_max __pyx_string_tab[267] +#define __pyx_n_u_target_min __pyx_string_tab[268] +#define __pyx_n_u_target_value __pyx_string_tab[269] +#define __pyx_n_u_target_var __pyx_string_tab[270] +#define __pyx_n_u_temp_sum __pyx_string_tab[271] +#define __pyx_n_u_test __pyx_string_tab[272] +#define __pyx_n_u_throw __pyx_string_tab[273] +#define __pyx_n_u_unassigned __pyx_string_tab[274] +#define __pyx_n_u_unassigned_2 __pyx_string_tab[275] +#define __pyx_n_u_unassigned_vars __pyx_string_tab[276] +#define __pyx_n_u_unassignedvariable __pyx_string_tab[277] +#define __pyx_n_u_v __pyx_string_tab[278] +#define __pyx_n_u_val __pyx_string_tab[279] +#define __pyx_n_u_value __pyx_string_tab[280] +#define __pyx_n_u_values __pyx_string_tab[281] +#define __pyx_n_u_var __pyx_string_tab[282] +#define __pyx_n_u_var_is_negative __pyx_string_tab[283] +#define __pyx_n_u_var_max __pyx_string_tab[284] +#define __pyx_n_u_var_min __pyx_string_tab[285] +#define __pyx_n_u_variable __pyx_string_tab[286] +#define __pyx_n_u_variable_contains_lt1 __pyx_string_tab[287] +#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[288] +#define __pyx_n_u_variables __pyx_string_tab[289] +#define __pyx_n_u_vconstraints __pyx_string_tab[290] +#define __pyx_n_u_x __pyx_string_tab[291] +#define __pyx_n_u_zip __pyx_string_tab[292] +#define __pyx_kp_b_iso88591_3gQ __pyx_string_tab[293] +#define __pyx_kp_b_iso88591_55H_a_4_7_1_4q_1_G4q_t3a_Kq_waq __pyx_string_tab[294] +#define __pyx_kp_b_iso88591_55H_a_4_7_1_4q_Q_G4q_t3a_AQ_4q __pyx_string_tab[295] +#define __pyx_kp_b_iso88591_55H_a_D_q_a_3at_Cs_1_A_7_Q_J_c __pyx_string_tab[296] +#define __pyx_kp_b_iso88591_55H_a_L_y_q_q_a_q_L_Kq_QfA_5_q __pyx_string_tab[297] +#define __pyx_kp_b_iso88591_55H_a_a_q_a_3at_Cs_1_A_7_Q_J_c __pyx_string_tab[298] +#define __pyx_kp_b_iso88591_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A __pyx_string_tab[299] +#define __pyx_kp_b_iso88591_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A_2 __pyx_string_tab[300] +#define __pyx_kp_b_iso88591_55H_a_d_4q_a_1_1_1Kq_9Cq_az_1_t __pyx_string_tab[301] +#define __pyx_kp_b_iso88591_55H_a_d_L_y_1_AZs_1_1_t1_5_c_WH __pyx_string_tab[302] +#define __pyx_kp_b_iso88591_55H_a_d_L_y_1_AZwa_1_1_t1_5_c_W __pyx_string_tab[303] +#define __pyx_kp_b_iso88591_55H_a_d_Q_a_1_1Kq_9Cq_az_1_t9AQ __pyx_string_tab[304] +#define __pyx_kp_b_iso88591_55H_a_d_Q_a_1_1_1Kq_9Cq_az_1_t9 __pyx_string_tab[305] +#define __pyx_kp_b_iso88591_55H_a_q __pyx_string_tab[306] +#define __pyx_kp_b_iso88591_6a_N_A __pyx_string_tab[307] +#define __pyx_kp_b_iso88591_6a_N_A_2 __pyx_string_tab[308] +#define __pyx_kp_b_iso88591_77JJeef_3a_Q_y_WAQ_q_4t1Kz_1_wb __pyx_string_tab[309] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J __pyx_string_tab[310] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J_2 __pyx_string_tab[311] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_WAT_1A_G4q_T_Qi __pyx_string_tab[312] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_a_L_WAQ_q_6_Bd_A __pyx_string_tab[313] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_1_3at_a_IV1_vR __pyx_string_tab[314] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_4q_L __pyx_string_tab[315] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_L_Cq __pyx_string_tab[316] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_Q_L_C __pyx_string_tab[317] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4q_t1_S_A_IV1 __pyx_string_tab[318] +#define __pyx_kp_b_iso88591_77JJeef_QfKy_Q_q_A_S_S_G4q_4_1I __pyx_string_tab[319] +#define __pyx_kp_b_iso88591_77JJeef_d_L_WAQ_q_6_6_7_F __pyx_string_tab[320] +#define __pyx_kp_b_iso88591_77JJeef_d_L_WAQ_q_6_A_6_7_F __pyx_string_tab[321] +#define __pyx_kp_b_iso88591_88XXY __pyx_string_tab[322] +#define __pyx_kp_b_iso88591_8_l_1 __pyx_string_tab[323] +#define __pyx_kp_b_iso88591_99LL___Q_L_y_q_c_1_q_1_4t1Ky_AQ __pyx_string_tab[324] +#define __pyx_kp_b_iso88591_A __pyx_string_tab[325] +#define __pyx_kp_b_iso88591_A_2 __pyx_string_tab[326] +#define __pyx_kp_b_iso88591_A_A_E_r_A_WA_WAQ_1_82Q_D_3d_M_HC __pyx_string_tab[327] +#define __pyx_kp_b_iso88591_A_HA __pyx_string_tab[328] +#define __pyx_kp_b_iso88591_A_a_L_Kt1Ja_3a_a_wl_fCq_q_L_q_A __pyx_string_tab[329] +#define __pyx_kp_b_iso88591_A_q_E_A_q __pyx_string_tab[330] +#define __pyx_kp_b_iso88591_A_q_L_Kt1Ja_vWA_6_A_1_AYa_1_A_9G __pyx_string_tab[331] +#define __pyx_kp_b_iso88591_E_HA_F_Ja __pyx_string_tab[332] +#define __pyx_kp_b_iso88591_L __pyx_string_tab[333] +#define __pyx_kp_b_iso88591_L_6a __pyx_string_tab[334] +#define __pyx_kp_b_iso88591_M_Kq_A_L __pyx_string_tab[335] +#define __pyx_kp_b_iso88591_M_Kq_A_L_2 __pyx_string_tab[336] +#define __pyx_kp_b_iso88591_N_6a __pyx_string_tab[337] +#define __pyx_kp_b_iso88591_Q __pyx_string_tab[338] +#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[339] +#define __pyx_kp_b_iso88591_Q_3 __pyx_string_tab[340] +#define __pyx_kp_b_iso88591_Q_4 __pyx_string_tab[341] +#define __pyx_kp_b_iso88591_U_A_IQ_M __pyx_string_tab[342] +#define __pyx_kp_b_iso88591_Zz_IQ_M __pyx_string_tab[343] +#define __pyx_kp_b_iso88591__3 __pyx_string_tab[344] +#define __pyx_kp_b_iso88591_a_N_L_A_1_3a_Cs_Rs_J_b_3c __pyx_string_tab[345] +#define __pyx_kp_b_iso88591_m1_M_A_L_L __pyx_string_tab[346] +#define __pyx_kp_b_iso88591_q_G4q_t3a_Qa_t1_3avS_4q_3a_Qb_E __pyx_string_tab[347] +#define __pyx_kp_b_iso88591_q_G4q_t3a_Qa_t1_3avS_Qb_E_4q_3a __pyx_string_tab[348] +#define __pyx_int_0 __pyx_number_tab[0] +#define __pyx_int_1 __pyx_number_tab[1] +#define __pyx_int_10 __pyx_number_tab[2] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3938,12 +3813,6 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif #if CYTHON_PEP489_MULTI_PHASE_INIT __Pyx_State_RemoveModule(NULL); #endif @@ -3965,10 +3834,10 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_8_preProcess); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_9_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr); @@ -3979,10 +3848,10 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_16___call__); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_15___call__); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr); @@ -3991,14 +3860,27 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_19___call__); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_22_genexpr); for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } - for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } - for (int i=0; i<75; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<288; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } - Py_CLEAR(clear_module_state->__pyx_int_0); - Py_CLEAR(clear_module_state->__pyx_int_1); - Py_CLEAR(clear_module_state->__pyx_int_10); - return 0; + for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } + for (int i=0; i<78; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<349; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); } +/* #### Code section: module_state_clear_contents ### */ +/* CommonTypesMetaclass.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType); + +/* CythonFunctionShared.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + +/* Generator.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_GeneratorType); + +/* #### Code section: module_state_clear_end ### */ +return 0; } #endif /* #### Code section: module_state_traverse ### */ @@ -4012,12 +3894,6 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); - #endif Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_defaults); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_defaults); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr); @@ -4036,10 +3912,10 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_8_preProcess); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_9_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr); @@ -4050,10 +3926,10 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_16___call__); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_15___call__); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr); @@ -4062,19 +3938,32 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_19___call__); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_22_genexpr); for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } - for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } - for (int i=0; i<75; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<288; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_10); - return 0; + for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } + for (int i=0; i<78; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<349; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); } +/* #### Code section: module_state_traverse_contents ### */ +/* CommonTypesMetaclass.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType); + +/* CythonFunctionShared.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + +/* Generator.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_GeneratorType); + +/* #### Code section: module_state_traverse_end ### */ +return 0; } #endif /* #### Code section: module_code ### */ -/* "constraint/constraints.py":11 +/* "constraint/constraints.py":12 * """Abstract base class for constraints.""" * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< @@ -4126,53 +4015,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 11, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 12, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 11, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 12, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 11, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 12, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 11, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 12, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 11, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 12, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 11, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 12, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 11, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 12, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 11, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 12, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 11, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 12, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 11, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 12, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 11, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 12, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 11, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 12, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 11, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 12, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -4186,7 +4075,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 11, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 12, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4197,8 +4086,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 11, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 11, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 12, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 12, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_10Constraint___call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -4223,7 +4112,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":34 + /* "constraint/constraints.py":35 * broken or not * """ * return True # <<<<<<<<<<<<<< @@ -4235,7 +4124,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHO __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":11 + /* "constraint/constraints.py":12 * """Abstract base class for constraints.""" * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< @@ -4250,7 +4139,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHO return __pyx_r; } -/* "constraint/constraints.py":36 +/* "constraint/constraints.py":37 * return True * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< @@ -4302,50 +4191,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 36, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 37, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 36, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 37, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 36, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 37, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 36, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 37, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 36, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 37, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 36, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 37, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 36, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 37, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 36, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 37, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 36, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 37, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 36, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 37, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 36, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 37, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 36, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 37, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 36, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 37, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -4355,7 +4244,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 36, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 37, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4366,9 +4255,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 36, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 36, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 36, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 37, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 37, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 37, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_10Constraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -4409,58 +4298,58 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":55 + /* "constraint/constraints.py":56 * of constraints affecting the given variables. * """ * if len(variables) == 1: # <<<<<<<<<<<<<< * variable = variables[0] * domain = domains[variable] */ - __pyx_t_1 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_1 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 56, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 1); if (__pyx_t_2) { - /* "constraint/constraints.py":56 + /* "constraint/constraints.py":57 * """ * if len(variables) == 1: * variable = variables[0] # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_variable = __pyx_t_3; __pyx_t_3 = 0; - /* "constraint/constraints.py":57 + /* "constraint/constraints.py":58 * if len(variables) == 1: * variable = variables[0] * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if not self(variables, domains, {variable: value}): */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_domain = __pyx_t_3; __pyx_t_3 = 0; - /* "constraint/constraints.py":58 + /* "constraint/constraints.py":59 * variable = variables[0] * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if not self(variables, domains, {variable: value}): * domain.remove(value) */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -4469,17 +4358,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 58, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 59, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_1); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_1, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_1; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 58, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 59, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } @@ -4490,13 +4379,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY #endif ++__pyx_t_1; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 58, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 59, __pyx_L1_error) PyErr_Clear(); } break; @@ -4506,7 +4395,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":59 + /* "constraint/constraints.py":60 * domain = domains[variable] * for value in domain[:]: * if not self(variables, domains, {variable: value}): # <<<<<<<<<<<<<< @@ -4516,9 +4405,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY __pyx_t_6 = NULL; __Pyx_INCREF(__pyx_v_self); __pyx_t_7 = __pyx_v_self; - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_v_variable, __pyx_v_value) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_v_variable, __pyx_v_value) < (0)) __PYX_ERR(0, 60, __pyx_L1_error) __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { @@ -4533,19 +4422,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_variables, __pyx_v_domains, __pyx_t_8}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = (!__pyx_t_2); if (__pyx_t_10) { - /* "constraint/constraints.py":60 + /* "constraint/constraints.py":61 * for value in domain[:]: * if not self(variables, domains, {variable: value}): * domain.remove(value) # <<<<<<<<<<<<<< @@ -4557,14 +4446,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_value}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":59 + /* "constraint/constraints.py":60 * domain = domains[variable] * for value in domain[:]: * if not self(variables, domains, {variable: value}): # <<<<<<<<<<<<<< @@ -4573,7 +4462,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY */ } - /* "constraint/constraints.py":58 + /* "constraint/constraints.py":59 * variable = variables[0] * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -4583,58 +4472,58 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":61 + /* "constraint/constraints.py":62 * if not self(variables, domains, {variable: value}): * domain.remove(value) * constraints.remove((self, variables)) # <<<<<<<<<<<<<< * vconstraints[variable].remove((self, variables)) * */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 61, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 62, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 61, __pyx_L1_error); - __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__remove, __pyx_v_constraints, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 62, __pyx_L1_error); + __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__remove, __pyx_v_constraints, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":62 + /* "constraint/constraints.py":63 * domain.remove(value) * constraints.remove((self, variables)) * vconstraints[variable].remove((self, variables)) # <<<<<<<<<<<<<< * * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): */ - __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 62, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 63, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 62, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 63, __pyx_L1_error); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":55 + /* "constraint/constraints.py":56 * of constraints affecting the given variables. * """ * if len(variables) == 1: # <<<<<<<<<<<<<< @@ -4643,7 +4532,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY */ } - /* "constraint/constraints.py":36 + /* "constraint/constraints.py":37 * return True * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< @@ -4671,7 +4560,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY return __pyx_r; } -/* "constraint/constraints.py":64 +/* "constraint/constraints.py":65 * vconstraints[variable].remove((self, variables)) * * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< @@ -4679,7 +4568,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * */ -static PyObject *__pyx_pf_10constraint_11constraints___defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10constraint_11constraints_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -4689,18 +4578,18 @@ static PyObject *__pyx_pf_10constraint_11constraints___defaults__(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 64, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 65, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 64, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 65, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 64, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 65, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -4763,53 +4652,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_unassigned,0}; struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self); const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 64, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 65, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 64, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 65, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 64, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 65, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 64, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 65, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 64, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 65, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 64, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 65, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "forwardCheck", 0) < 0) __PYX_ERR(0, 64, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "forwardCheck", 0) < (0)) __PYX_ERR(0, 65, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(__pyx_dynamic_args->arg0); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("forwardCheck", 0, 4, 5, i); __PYX_ERR(0, 64, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("forwardCheck", 0, 4, 5, i); __PYX_ERR(0, 65, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 64, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 65, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 64, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 65, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 64, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 65, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 64, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 65, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 64, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 65, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -4823,7 +4712,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("forwardCheck", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 64, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("forwardCheck", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 65, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4834,8 +4723,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 64, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 64, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 65, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v__unassigned); /* function exit code */ @@ -4876,7 +4765,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("forwardCheck", 0); - /* "constraint/constraints.py":82 + /* "constraint/constraints.py":83 * broken or not * """ * unassignedvariable = _unassigned # <<<<<<<<<<<<<< @@ -4886,7 +4775,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __Pyx_INCREF(__pyx_v__unassigned); __pyx_v_unassignedvariable = __pyx_v__unassigned; - /* "constraint/constraints.py":83 + /* "constraint/constraints.py":84 * """ * unassignedvariable = _unassigned * for variable in variables: # <<<<<<<<<<<<<< @@ -4898,9 +4787,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -4908,17 +4797,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 84, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 84, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4929,13 +4818,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 84, __pyx_L1_error) PyErr_Clear(); } break; @@ -4945,17 +4834,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":84 + /* "constraint/constraints.py":85 * unassignedvariable = _unassigned * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * if unassignedvariable is _unassigned: * unassignedvariable = variable */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 85, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":85 + /* "constraint/constraints.py":86 * for variable in variables: * if variable not in assignments: * if unassignedvariable is _unassigned: # <<<<<<<<<<<<<< @@ -4965,7 +4854,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __pyx_t_5 = (__pyx_v_unassignedvariable == __pyx_v__unassigned); if (__pyx_t_5) { - /* "constraint/constraints.py":86 + /* "constraint/constraints.py":87 * if variable not in assignments: * if unassignedvariable is _unassigned: * unassignedvariable = variable # <<<<<<<<<<<<<< @@ -4975,7 +4864,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __Pyx_INCREF(__pyx_v_variable); __Pyx_DECREF_SET(__pyx_v_unassignedvariable, __pyx_v_variable); - /* "constraint/constraints.py":85 + /* "constraint/constraints.py":86 * for variable in variables: * if variable not in assignments: * if unassignedvariable is _unassigned: # <<<<<<<<<<<<<< @@ -4985,7 +4874,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( goto __pyx_L6; } - /* "constraint/constraints.py":88 + /* "constraint/constraints.py":89 * unassignedvariable = variable * else: * break # <<<<<<<<<<<<<< @@ -4997,7 +4886,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( } __pyx_L6:; - /* "constraint/constraints.py":84 + /* "constraint/constraints.py":85 * unassignedvariable = _unassigned * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -5006,7 +4895,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( */ } - /* "constraint/constraints.py":83 + /* "constraint/constraints.py":84 * """ * unassignedvariable = _unassigned * for variable in variables: # <<<<<<<<<<<<<< @@ -5022,7 +4911,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( /*else*/ { __pyx_L7_for_else:; - /* "constraint/constraints.py":90 + /* "constraint/constraints.py":91 * break * else: * if unassignedvariable is not _unassigned: # <<<<<<<<<<<<<< @@ -5032,45 +4921,45 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __pyx_t_5 = (__pyx_v_unassignedvariable != __pyx_v__unassigned); if (__pyx_t_5) { - /* "constraint/constraints.py":93 + /* "constraint/constraints.py":94 * # Remove from the unassigned variable domain's all * # values which break our variable's constraints. * domain = domains[unassignedvariable] # <<<<<<<<<<<<<< * if domain: * for value in domain[:]: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_unassignedvariable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_unassignedvariable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_domain = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":94 + /* "constraint/constraints.py":95 * # values which break our variable's constraints. * domain = domains[unassignedvariable] * if domain: # <<<<<<<<<<<<<< * for value in domain[:]: * assignments[unassignedvariable] = value */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 95, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":95 + /* "constraint/constraints.py":96 * domain = domains[unassignedvariable] * if domain: * for value in domain[:]: # <<<<<<<<<<<<<< * assignments[unassignedvariable] = value * if not self(variables, domains, assignments): */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -5079,17 +4968,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 95, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 96, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_2); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 95, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 96, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5100,13 +4989,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 95, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 96, __pyx_L1_error) PyErr_Clear(); } break; @@ -5116,16 +5005,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":96 + /* "constraint/constraints.py":97 * if domain: * for value in domain[:]: * assignments[unassignedvariable] = value # <<<<<<<<<<<<<< * if not self(variables, domains, assignments): * domain.hideValue(value) */ - if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_unassignedvariable, __pyx_v_value) < 0))) __PYX_ERR(0, 96, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_unassignedvariable, __pyx_v_value) < 0))) __PYX_ERR(0, 97, __pyx_L1_error) - /* "constraint/constraints.py":97 + /* "constraint/constraints.py":98 * for value in domain[:]: * assignments[unassignedvariable] = value * if not self(variables, domains, assignments): # <<<<<<<<<<<<<< @@ -5149,18 +5038,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = (!__pyx_t_5); if (__pyx_t_9) { - /* "constraint/constraints.py":98 + /* "constraint/constraints.py":99 * assignments[unassignedvariable] = value * if not self(variables, domains, assignments): * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -5172,14 +5061,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":97 + /* "constraint/constraints.py":98 * for value in domain[:]: * assignments[unassignedvariable] = value * if not self(variables, domains, assignments): # <<<<<<<<<<<<<< @@ -5188,7 +5077,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( */ } - /* "constraint/constraints.py":95 + /* "constraint/constraints.py":96 * domain = domains[unassignedvariable] * if domain: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -5198,16 +5087,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":99 + /* "constraint/constraints.py":100 * if not self(variables, domains, assignments): * domain.hideValue(value) * del assignments[unassignedvariable] # <<<<<<<<<<<<<< * if not domain: * return False */ - if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_unassignedvariable) < 0))) __PYX_ERR(0, 99, __pyx_L1_error) + if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_unassignedvariable) < 0))) __PYX_ERR(0, 100, __pyx_L1_error) - /* "constraint/constraints.py":94 + /* "constraint/constraints.py":95 * # values which break our variable's constraints. * domain = domains[unassignedvariable] * if domain: # <<<<<<<<<<<<<< @@ -5216,18 +5105,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( */ } - /* "constraint/constraints.py":100 + /* "constraint/constraints.py":101 * domain.hideValue(value) * del assignments[unassignedvariable] * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 101, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_9); if (__pyx_t_5) { - /* "constraint/constraints.py":101 + /* "constraint/constraints.py":102 * del assignments[unassignedvariable] * if not domain: * return False # <<<<<<<<<<<<<< @@ -5239,7 +5128,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":100 + /* "constraint/constraints.py":101 * domain.hideValue(value) * del assignments[unassignedvariable] * if not domain: # <<<<<<<<<<<<<< @@ -5248,7 +5137,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( */ } - /* "constraint/constraints.py":90 + /* "constraint/constraints.py":91 * break * else: * if unassignedvariable is not _unassigned: # <<<<<<<<<<<<<< @@ -5259,7 +5148,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( } __pyx_L8_for_end:; - /* "constraint/constraints.py":102 + /* "constraint/constraints.py":103 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -5271,7 +5160,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":64 + /* "constraint/constraints.py":65 * vconstraints[variable].remove((self, variables)) * * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< @@ -5297,7 +5186,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( return __pyx_r; } -/* "constraint/constraints.py":126 +/* "constraint/constraints.py":134 * """ * * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< @@ -5324,7 +5213,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_func = 0; - PyObject *__pyx_v_assigned = 0; + int __pyx_v_assigned; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -5347,53 +5236,55 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_func,&__pyx_mstate_global->__pyx_n_u_assigned,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 126, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 134, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 126, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 134, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 126, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 134, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 126, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 134, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 126, __pyx_L3_error) - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 134, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 126, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 134, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 126, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 134, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 126, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 134, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 126, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 134, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); } __pyx_v_self = values[0]; __pyx_v_func = values[1]; - __pyx_v_assigned = values[2]; + if (values[2]) { + __pyx_v_assigned = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_assigned == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L3_error) + } else { + __pyx_v_assigned = ((int)((int)1)); + } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 126, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 134, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5414,33 +5305,37 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_assigned) { +static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func, int __pyx_v_assigned) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":135 + /* "constraint/constraints.py":143 * variables or not * """ * self._func = func # <<<<<<<<<<<<<< * self._assigned = assigned * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_func_2, __pyx_v_func) < 0) __PYX_ERR(0, 135, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_func_2, __pyx_v_func) < (0)) __PYX_ERR(0, 143, __pyx_L1_error) - /* "constraint/constraints.py":136 + /* "constraint/constraints.py":144 * """ * self._func = func * self._assigned = assigned # <<<<<<<<<<<<<< * * def __call__( # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_assigned_2, __pyx_v_assigned) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_assigned); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_assigned_2, __pyx_t_1) < (0)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":126 + /* "constraint/constraints.py":134 * """ * * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< @@ -5452,6 +5347,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("constraint.constraints.FunctionConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -5460,7 +5356,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init return __pyx_r; } -/* "constraint/constraints.py":138 +/* "constraint/constraints.py":146 * self._assigned = assigned * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -5468,7 +5364,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init * variables: Sequence, */ -static PyObject *__pyx_pf_10constraint_11constraints_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10constraint_11constraints_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -5479,36 +5375,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_2__defaults__(CYTHON_UNUSED __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - /* "constraint/constraints.py":143 + /* "constraint/constraints.py":151 * domains: dict, * assignments: dict, * forwardcheck=False, # <<<<<<<<<<<<<< * _unassigned=Unassigned, * ): */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject*)Py_False)); __Pyx_GIVEREF(((PyObject*)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)Py_False)) != (0)) __PYX_ERR(0, 138, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)Py_False)) != (0)) __PYX_ERR(0, 146, __pyx_L1_error); __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 138, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 146, __pyx_L1_error); - /* "constraint/constraints.py":138 + /* "constraint/constraints.py":146 * self._assigned = assigned * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 138, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 146, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 138, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 146, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -5571,62 +5467,62 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,&__pyx_mstate_global->__pyx_n_u_unassigned,0}; struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self); const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 138, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 146, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 138, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 146, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); if (!values[5]) values[5] = __Pyx_NewRef(__pyx_dynamic_args->arg0); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, i); __PYX_ERR(0, 138, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, i); __PYX_ERR(0, 146, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 146, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 146, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 146, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 138, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 146, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -5642,7 +5538,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 138, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 146, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5653,8 +5549,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 141, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 142, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 149, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 150, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_18FunctionConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck, __pyx_v__unassigned); /* function exit code */ @@ -5695,19 +5591,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":175 + /* "constraint/constraints.py":183 * * # single loop list: 0.11462 seconds, Cythonized: 0.08686 seconds * parms = list() # <<<<<<<<<<<<<< * missing = 0 * for x in variables: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parms = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":176 + /* "constraint/constraints.py":184 * # single loop list: 0.11462 seconds, Cythonized: 0.08686 seconds * parms = list() * missing = 0 # <<<<<<<<<<<<<< @@ -5717,7 +5613,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":177 + /* "constraint/constraints.py":185 * parms = list() * missing = 0 * for x in variables: # <<<<<<<<<<<<<< @@ -5729,9 +5625,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -5739,17 +5635,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 177, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 185, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 177, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 185, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -5760,13 +5656,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 177, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 185, __pyx_L1_error) PyErr_Clear(); } break; @@ -5776,29 +5672,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":178 + /* "constraint/constraints.py":186 * missing = 0 * for x in variables: * if x in assignments: # <<<<<<<<<<<<<< * parms.append(assignments[x]) * else: */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_x, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_x, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":179 + /* "constraint/constraints.py":187 * for x in variables: * if x in assignments: * parms.append(assignments[x]) # <<<<<<<<<<<<<< * else: * parms.append(_unassigned) */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parms, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parms, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":178 + /* "constraint/constraints.py":186 * missing = 0 * for x in variables: * if x in assignments: # <<<<<<<<<<<<<< @@ -5808,7 +5704,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal goto __pyx_L5; } - /* "constraint/constraints.py":181 + /* "constraint/constraints.py":189 * parms.append(assignments[x]) * else: * parms.append(_unassigned) # <<<<<<<<<<<<<< @@ -5816,23 +5712,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * */ /*else*/ { - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parms, __pyx_v__unassigned); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parms, __pyx_v__unassigned); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 189, __pyx_L1_error) - /* "constraint/constraints.py":182 + /* "constraint/constraints.py":190 * else: * parms.append(_unassigned) * missing += 1 # <<<<<<<<<<<<<< * * # if there are unassigned variables, do a forward check before executing the restriction function */ - __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_v_missing, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_v_missing, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_missing, __pyx_t_4); __pyx_t_4 = 0; } __pyx_L5:; - /* "constraint/constraints.py":177 + /* "constraint/constraints.py":185 * parms = list() * missing = 0 * for x in variables: # <<<<<<<<<<<<<< @@ -5842,19 +5738,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":185 + /* "constraint/constraints.py":193 * * # if there are unassigned variables, do a forward check before executing the restriction function * if missing > 0: # <<<<<<<<<<<<<< * return (self._assigned or self._func(*parms)) and ( * not forwardcheck or missing != 1 or self.forwardCheck(variables, domains, assignments) */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_missing, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_missing, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":186 + /* "constraint/constraints.py":194 * # if there are unassigned variables, do a forward check before executing the restriction function * if missing > 0: * return (self._assigned or self._func(*parms)) and ( # <<<<<<<<<<<<<< @@ -5862,23 +5758,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * ) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_assigned_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_assigned_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_5) { } else { goto __pyx_L9_next_and; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_func_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_func_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PySequence_Tuple(__pyx_v_parms); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_7 = PySequence_Tuple(__pyx_v_parms); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 194, __pyx_L1_error) if (__pyx_t_5) { __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { @@ -5889,26 +5785,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal } __pyx_L9_next_and:; - /* "constraint/constraints.py":187 + /* "constraint/constraints.py":195 * if missing > 0: * return (self._assigned or self._func(*parms)) and ( * not forwardcheck or missing != 1 or self.forwardCheck(variables, domains, assignments) # <<<<<<<<<<<<<< * ) * return self._func(*parms) */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 195, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_5); if (!__pyx_t_9) { } else { - __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L8_bool_binop_done; } - __pyx_t_8 = __Pyx_PyLong_NeObjC(__pyx_v_missing, __pyx_mstate_global->__pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_NeObjC(__pyx_v_missing, __pyx_mstate_global->__pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 195, __pyx_L1_error) if (!__pyx_t_9) { __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { @@ -5922,9 +5818,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __pyx_t_10 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_forwardCheck, __pyx_callargs+__pyx_t_10, (4-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_forwardCheck, __pyx_callargs+__pyx_t_10, (4-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 187, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_INCREF(__pyx_t_8); @@ -5935,7 +5831,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":185 + /* "constraint/constraints.py":193 * * # if there are unassigned variables, do a forward check before executing the restriction function * if missing > 0: # <<<<<<<<<<<<<< @@ -5944,7 +5840,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal */ } - /* "constraint/constraints.py":189 + /* "constraint/constraints.py":197 * not forwardcheck or missing != 1 or self.forwardCheck(variables, domains, assignments) * ) * return self._func(*parms) # <<<<<<<<<<<<<< @@ -5952,11 +5848,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * class CompilableFunctionConstraint(Constraint): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_func_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_func_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PySequence_Tuple(__pyx_v_parms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_8 = PySequence_Tuple(__pyx_v_parms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -5964,7 +5860,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/constraints.py":138 + /* "constraint/constraints.py":146 * self._assigned = assigned * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -5989,7 +5885,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal return __pyx_r; } -/* "constraint/constraints.py":194 +/* "constraint/constraints.py":202 * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" * * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 # <<<<<<<<<<<<<< @@ -6015,7 +5911,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_func = 0; - PyObject *__pyx_v_assigned = 0; + int __pyx_v_assigned; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -6038,53 +5934,55 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_func,&__pyx_mstate_global->__pyx_n_u_assigned,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 194, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 202, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 194, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 202, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 194, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 202, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 194, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 202, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 194, __pyx_L3_error) - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 202, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 194, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 202, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 194, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 202, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 194, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 202, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 194, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 202, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); } __pyx_v_self = values[0]; __pyx_v_func = ((PyObject*)values[1]); - __pyx_v_assigned = values[2]; + if (values[2]) { + __pyx_v_assigned = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_assigned == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L3_error) + } else { + __pyx_v_assigned = ((int)((int)1)); + } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 194, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 202, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6095,7 +5993,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_func), (&PyUnicode_Type), 0, "func", 2))) __PYX_ERR(0, 194, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_func), (&PyUnicode_Type), 0, "func", 2))) __PYX_ERR(0, 202, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_28CompilableFunctionConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_func, __pyx_v_assigned); /* function exit code */ @@ -6115,33 +6013,37 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_assigned) { +static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_func, int __pyx_v_assigned) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":195 + /* "constraint/constraints.py":203 * * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 * self._func = func # <<<<<<<<<<<<<< * self._assigned = assigned * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_func_2, __pyx_v_func) < 0) __PYX_ERR(0, 195, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_func_2, __pyx_v_func) < (0)) __PYX_ERR(0, 203, __pyx_L1_error) - /* "constraint/constraints.py":196 + /* "constraint/constraints.py":204 * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 * self._func = func * self._assigned = assigned # <<<<<<<<<<<<<< * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_assigned_2, __pyx_v_assigned) < 0) __PYX_ERR(0, 196, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_assigned); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_assigned_2, __pyx_t_1) < (0)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":194 + /* "constraint/constraints.py":202 * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" * * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 # <<<<<<<<<<<<<< @@ -6153,57 +6055,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.CompilableFunctionConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "constraint/constraints.py":198 - * self._assigned = assigned - * - * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< - * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") - * -*/ - -static PyObject *__pyx_pf_10constraint_11constraints_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject*)Py_False)); - __Pyx_GIVEREF(((PyObject*)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)Py_False)) != (0)) __PYX_ERR(0, 198, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 198, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 198, __pyx_L1_error); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 198, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("constraint.constraints.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("constraint.constraints.CompilableFunctionConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -6211,179 +6064,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_4__defaults__(CYTHON_UNUSED return __pyx_r; } -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_28CompilableFunctionConstraint_3__call__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_28CompilableFunctionConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_28CompilableFunctionConstraint_3__call__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - CYTHON_UNUSED PyObject *__pyx_v_self = 0; - CYTHON_UNUSED PyObject *__pyx_v_variables = 0; - CYTHON_UNUSED PyObject *__pyx_v_domains = 0; - CYTHON_UNUSED PyObject *__pyx_v_assignments = 0; - CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 0; - CYTHON_UNUSED PyObject *__pyx_v__unassigned = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[6] = {0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,&__pyx_mstate_global->__pyx_n_u_unassigned,0}; - struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self); - const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 198, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 6: - values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 198, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 5: - values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 198, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 4: - values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 198, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 3: - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 198, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 2: - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 198, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 1: - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 198, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 198, __pyx_L3_error) - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[5]) values[5] = __Pyx_NewRef(__pyx_dynamic_args->arg0); - for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, i); __PYX_ERR(0, 198, __pyx_L3_error) } - } - } else { - switch (__pyx_nargs) { - case 6: - values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 198, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 5: - values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 198, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 4: - values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 198, __pyx_L3_error) - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 198, __pyx_L3_error) - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 198, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 198, __pyx_L3_error) - break; - default: goto __pyx_L5_argtuple_error; - } - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); - if (!values[5]) values[5] = __Pyx_NewRef(__pyx_dynamic_args->arg0); - } - __pyx_v_self = values[0]; - __pyx_v_variables = values[1]; - __pyx_v_domains = values[2]; - __pyx_v_assignments = values[3]; - __pyx_v_forwardcheck = values[4]; - __pyx_v__unassigned = values[5]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 198, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_AddTraceback("constraint.constraints.CompilableFunctionConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10constraint_11constraints_28CompilableFunctionConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck, __pyx_v__unassigned); - - /* function exit code */ - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstraint_2__call__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_variables, CYTHON_UNUSED PyObject *__pyx_v_domains, CYTHON_UNUSED PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck, CYTHON_UNUSED PyObject *__pyx_v__unassigned) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 0); - - /* "constraint/constraints.py":199 - * - * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 - * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") # <<<<<<<<<<<<<< - * - * -*/ - __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_NotImplementedError); - __pyx_t_3 = __pyx_builtin_NotImplementedError; - __pyx_t_4 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_CompilableFunctionConstraint_can}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 199, __pyx_L1_error) - - /* "constraint/constraints.py":198 +/* "constraint/constraints.py":206 * self._assigned = assigned * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< @@ -6391,26 +6072,6 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * */ - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("constraint.constraints.CompilableFunctionConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "constraint/constraints.py":213 - * """ - * - * def __call__( # noqa: D102 # <<<<<<<<<<<<<< - * self, - * variables: Sequence, -*/ - static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -6421,37 +6082,274 @@ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - - /* "constraint/constraints.py":218 - * domains: dict, - * assignments: dict, - * forwardcheck=False, # <<<<<<<<<<<<<< - * _unassigned=Unassigned, - * ): -*/ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject*)Py_False)); __Pyx_GIVEREF(((PyObject*)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)Py_False)) != (0)) __PYX_ERR(0, 213, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)Py_False)) != (0)) __PYX_ERR(0, 206, __pyx_L1_error); __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 213, __pyx_L1_error); - - /* "constraint/constraints.py":213 - * """ - * - * def __call__( # noqa: D102 # <<<<<<<<<<<<<< - * self, - * variables: Sequence, -*/ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 206, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 213, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 206, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 213, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 206, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("constraint.constraints.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_28CompilableFunctionConstraint_3__call__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_28CompilableFunctionConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_28CompilableFunctionConstraint_3__call__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + CYTHON_UNUSED PyObject *__pyx_v_variables = 0; + CYTHON_UNUSED PyObject *__pyx_v_domains = 0; + CYTHON_UNUSED PyObject *__pyx_v_assignments = 0; + CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 0; + CYTHON_UNUSED PyObject *__pyx_v__unassigned = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[6] = {0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_SIZE + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,&__pyx_mstate_global->__pyx_n_u_unassigned,0}; + struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self); + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 206, __pyx_L3_error) + if (__pyx_kwds_len > 0) { + switch (__pyx_nargs) { + case 6: + values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 206, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 206, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 206, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 206, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 206, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 206, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 206, __pyx_L3_error) + if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + if (!values[5]) values[5] = __Pyx_NewRef(__pyx_dynamic_args->arg0); + for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, i); __PYX_ERR(0, 206, __pyx_L3_error) } + } + } else { + switch (__pyx_nargs) { + case 6: + values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 206, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 206, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 206, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 206, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 206, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 206, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; + } + if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + if (!values[5]) values[5] = __Pyx_NewRef(__pyx_dynamic_args->arg0); + } + __pyx_v_self = values[0]; + __pyx_v_variables = values[1]; + __pyx_v_domains = values[2]; + __pyx_v_assignments = values[3]; + __pyx_v_forwardcheck = values[4]; + __pyx_v__unassigned = values[5]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 206, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __Pyx_AddTraceback("constraint.constraints.CompilableFunctionConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10constraint_11constraints_28CompilableFunctionConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck, __pyx_v__unassigned); + + /* function exit code */ + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstraint_2__call__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_variables, CYTHON_UNUSED PyObject *__pyx_v_domains, CYTHON_UNUSED PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck, CYTHON_UNUSED PyObject *__pyx_v__unassigned) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + size_t __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__call__", 0); + + /* "constraint/constraints.py":207 + * + * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 + * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") # <<<<<<<<<<<<<< + * + * +*/ + __pyx_t_2 = NULL; + __pyx_t_3 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_CompilableFunctionConstraint_can}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 207, __pyx_L1_error) + + /* "constraint/constraints.py":206 + * self._assigned = assigned + * + * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< + * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") + * +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("constraint.constraints.CompilableFunctionConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":221 + * """ + * + * def __call__( # noqa: D102 # <<<<<<<<<<<<<< + * self, + * variables: Sequence, +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__defaults__", 0); + __Pyx_XDECREF(__pyx_r); + + /* "constraint/constraints.py":226 + * domains: dict, + * assignments: dict, + * forwardcheck=False, # <<<<<<<<<<<<<< + * _unassigned=Unassigned, + * ): +*/ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject*)Py_False)); + __Pyx_GIVEREF(((PyObject*)Py_False)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)Py_False)) != (0)) __PYX_ERR(0, 221, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 221, __pyx_L1_error); + + /* "constraint/constraints.py":221 + * """ + * + * def __call__( # noqa: D102 # <<<<<<<<<<<<<< + * self, + * variables: Sequence, +*/ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 221, __pyx_L1_error); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 221, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -6514,62 +6412,62 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,&__pyx_mstate_global->__pyx_n_u_unassigned,0}; struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self); const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 213, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 221, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 213, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 221, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 213, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 221, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 213, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 221, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 213, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 221, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 213, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 221, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 213, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 221, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 213, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 221, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); if (!values[5]) values[5] = __Pyx_NewRef(__pyx_dynamic_args->arg0); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, i); __PYX_ERR(0, 213, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, i); __PYX_ERR(0, 221, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 213, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 221, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 213, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 221, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 213, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 221, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 213, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 221, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 213, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 221, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 213, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 221, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -6585,7 +6483,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 213, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 221, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6596,8 +6494,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 216, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 217, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 224, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 225, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_22AllDifferentConstraint___call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck, __pyx_v__unassigned); /* function exit code */ @@ -6642,19 +6540,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":221 + /* "constraint/constraints.py":229 * _unassigned=Unassigned, * ): * seen = {} # <<<<<<<<<<<<<< * for variable in variables: * value = assignments.get(variable, _unassigned) */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_seen = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":222 + /* "constraint/constraints.py":230 * ): * seen = {} * for variable in variables: # <<<<<<<<<<<<<< @@ -6666,9 +6564,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6676,17 +6574,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 222, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 230, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 222, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 230, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6697,13 +6595,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 222, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 230, __pyx_L1_error) PyErr_Clear(); } break; @@ -6713,19 +6611,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":223 + /* "constraint/constraints.py":231 * seen = {} * for variable in variables: * value = assignments.get(variable, _unassigned) # <<<<<<<<<<<<<< * if value is not _unassigned: * if value in seen: */ - __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_assignments, __pyx_v_variable, __pyx_v__unassigned); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_assignments, __pyx_v_variable, __pyx_v__unassigned); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":224 + /* "constraint/constraints.py":232 * for variable in variables: * value = assignments.get(variable, _unassigned) * if value is not _unassigned: # <<<<<<<<<<<<<< @@ -6735,17 +6633,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __pyx_t_5 = (__pyx_v_value != __pyx_v__unassigned); if (__pyx_t_5) { - /* "constraint/constraints.py":225 + /* "constraint/constraints.py":233 * value = assignments.get(variable, _unassigned) * if value is not _unassigned: * if value in seen: # <<<<<<<<<<<<<< * return False * seen[value] = True */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_value, __pyx_v_seen, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_value, __pyx_v_seen, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":226 + /* "constraint/constraints.py":234 * if value is not _unassigned: * if value in seen: * return False # <<<<<<<<<<<<<< @@ -6758,7 +6656,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":225 + /* "constraint/constraints.py":233 * value = assignments.get(variable, _unassigned) * if value is not _unassigned: * if value in seen: # <<<<<<<<<<<<<< @@ -6767,16 +6665,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":227 + /* "constraint/constraints.py":235 * if value in seen: * return False * seen[value] = True # <<<<<<<<<<<<<< * if forwardcheck: * for variable in variables: */ - if (unlikely((PyDict_SetItem(__pyx_v_seen, __pyx_v_value, Py_True) < 0))) __PYX_ERR(0, 227, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_seen, __pyx_v_value, Py_True) < 0))) __PYX_ERR(0, 235, __pyx_L1_error) - /* "constraint/constraints.py":224 + /* "constraint/constraints.py":232 * for variable in variables: * value = assignments.get(variable, _unassigned) * if value is not _unassigned: # <<<<<<<<<<<<<< @@ -6785,7 +6683,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":222 + /* "constraint/constraints.py":230 * ): * seen = {} * for variable in variables: # <<<<<<<<<<<<<< @@ -6795,17 +6693,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":228 + /* "constraint/constraints.py":236 * return False * seen[value] = True * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 236, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":229 + /* "constraint/constraints.py":237 * seen[value] = True * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -6817,9 +6715,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6827,17 +6725,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 229, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 237, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 229, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 237, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6848,13 +6746,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 229, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 237, __pyx_L1_error) PyErr_Clear(); } break; @@ -6864,29 +6762,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":230 + /* "constraint/constraints.py":238 * if forwardcheck: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in seen: */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 238, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":231 + /* "constraint/constraints.py":239 * for variable in variables: * if variable not in assignments: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in seen: * if value in domain: */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":232 + /* "constraint/constraints.py":240 * if variable not in assignments: * domain = domains[variable] * for value in seen: # <<<<<<<<<<<<<< @@ -6894,7 +6792,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * domain.hideValue(value) */ __pyx_t_6 = 0; - __pyx_t_9 = __Pyx_dict_iterator(__pyx_v_seen, 1, ((PyObject *)NULL), (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_9 = __Pyx_dict_iterator(__pyx_v_seen, 1, ((PyObject *)NULL), (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_9; @@ -6902,22 +6800,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ while (1) { __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_7, &__pyx_t_6, &__pyx_t_9, NULL, NULL, __pyx_t_8); if (unlikely(__pyx_t_10 == 0)) break; - if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 232, __pyx_L1_error) + if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":233 + /* "constraint/constraints.py":241 * domain = domains[variable] * for value in seen: * if value in domain: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_domain, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_domain, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 241, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":234 + /* "constraint/constraints.py":242 * for value in seen: * if value in domain: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -6929,25 +6827,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __pyx_t_12 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_value}; - __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 234, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":235 + /* "constraint/constraints.py":243 * if value in domain: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 243, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_5); if (__pyx_t_13) { - /* "constraint/constraints.py":236 + /* "constraint/constraints.py":244 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -6961,7 +6859,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/constraints.py":235 + /* "constraint/constraints.py":243 * if value in domain: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -6970,7 +6868,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":233 + /* "constraint/constraints.py":241 * domain = domains[variable] * for value in seen: * if value in domain: # <<<<<<<<<<<<<< @@ -6981,7 +6879,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":230 + /* "constraint/constraints.py":238 * if forwardcheck: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -6990,7 +6888,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":229 + /* "constraint/constraints.py":237 * seen[value] = True * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -7000,7 +6898,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":228 + /* "constraint/constraints.py":236 * return False * seen[value] = True * if forwardcheck: # <<<<<<<<<<<<<< @@ -7009,7 +6907,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ */ } - /* "constraint/constraints.py":237 + /* "constraint/constraints.py":245 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -7021,7 +6919,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":213 + /* "constraint/constraints.py":221 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -7047,7 +6945,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ return __pyx_r; } -/* "constraint/constraints.py":251 +/* "constraint/constraints.py":259 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -7055,7 +6953,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * variables: Sequence, */ -static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10constraint_11constraints_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -7066,36 +6964,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); - /* "constraint/constraints.py":256 + /* "constraint/constraints.py":264 * domains: dict, * assignments: dict, * forwardcheck=False, # <<<<<<<<<<<<<< * _unassigned=Unassigned, * ): */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject*)Py_False)); __Pyx_GIVEREF(((PyObject*)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)Py_False)) != (0)) __PYX_ERR(0, 251, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject*)Py_False)) != (0)) __PYX_ERR(0, 259, __pyx_L1_error); __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 251, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 259, __pyx_L1_error); - /* "constraint/constraints.py":251 + /* "constraint/constraints.py":259 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 251, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 259, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 251, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 259, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -7158,62 +7056,62 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,&__pyx_mstate_global->__pyx_n_u_unassigned,0}; struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self); const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 251, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 259, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 251, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 259, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 251, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 259, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 251, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 259, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 251, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 259, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 251, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 259, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 251, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 259, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 251, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 259, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); if (!values[5]) values[5] = __Pyx_NewRef(__pyx_dynamic_args->arg0); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, i); __PYX_ERR(0, 251, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, i); __PYX_ERR(0, 259, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 6: values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 251, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 259, __pyx_L3_error) CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 251, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 259, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 251, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 259, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 251, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 259, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 251, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 259, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 251, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 259, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -7229,7 +7127,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 251, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 259, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7240,8 +7138,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 254, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 255, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 262, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 263, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_18AllEqualConstraint___call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck, __pyx_v__unassigned); /* function exit code */ @@ -7284,7 +7182,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":259 + /* "constraint/constraints.py":267 * _unassigned=Unassigned, * ): * singlevalue = _unassigned # <<<<<<<<<<<<<< @@ -7294,7 +7192,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_INCREF(__pyx_v__unassigned); __pyx_v_singlevalue = __pyx_v__unassigned; - /* "constraint/constraints.py":260 + /* "constraint/constraints.py":268 * ): * singlevalue = _unassigned * for variable in variables: # <<<<<<<<<<<<<< @@ -7306,9 +7204,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -7316,17 +7214,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 260, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 268, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 260, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 268, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -7337,13 +7235,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 260, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 268, __pyx_L1_error) PyErr_Clear(); } break; @@ -7353,19 +7251,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":261 + /* "constraint/constraints.py":269 * singlevalue = _unassigned * for variable in variables: * value = assignments.get(variable, _unassigned) # <<<<<<<<<<<<<< * if singlevalue is _unassigned: * singlevalue = value */ - __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_assignments, __pyx_v_variable, __pyx_v__unassigned); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_assignments, __pyx_v_variable, __pyx_v__unassigned); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":262 + /* "constraint/constraints.py":270 * for variable in variables: * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: # <<<<<<<<<<<<<< @@ -7375,7 +7273,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __pyx_t_5 = (__pyx_v_singlevalue == __pyx_v__unassigned); if (__pyx_t_5) { - /* "constraint/constraints.py":263 + /* "constraint/constraints.py":271 * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: * singlevalue = value # <<<<<<<<<<<<<< @@ -7385,7 +7283,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_INCREF(__pyx_v_value); __Pyx_DECREF_SET(__pyx_v_singlevalue, __pyx_v_value); - /* "constraint/constraints.py":262 + /* "constraint/constraints.py":270 * for variable in variables: * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: # <<<<<<<<<<<<<< @@ -7395,7 +7293,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call goto __pyx_L5; } - /* "constraint/constraints.py":264 + /* "constraint/constraints.py":272 * if singlevalue is _unassigned: * singlevalue = value * elif value is not _unassigned and value != singlevalue: # <<<<<<<<<<<<<< @@ -7408,14 +7306,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __pyx_t_5 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } - __pyx_t_4 = PyObject_RichCompare(__pyx_v_value, __pyx_v_singlevalue, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_value, __pyx_v_singlevalue, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L6_bool_binop_done:; if (__pyx_t_5) { - /* "constraint/constraints.py":265 + /* "constraint/constraints.py":273 * singlevalue = value * elif value is not _unassigned and value != singlevalue: * return False # <<<<<<<<<<<<<< @@ -7428,7 +7326,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":264 + /* "constraint/constraints.py":272 * if singlevalue is _unassigned: * singlevalue = value * elif value is not _unassigned and value != singlevalue: # <<<<<<<<<<<<<< @@ -7438,7 +7336,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } __pyx_L5:; - /* "constraint/constraints.py":260 + /* "constraint/constraints.py":268 * ): * singlevalue = _unassigned * for variable in variables: # <<<<<<<<<<<<<< @@ -7448,14 +7346,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":266 + /* "constraint/constraints.py":274 * elif value is not _unassigned and value != singlevalue: * return False * if forwardcheck and singlevalue is not _unassigned: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 274, __pyx_L1_error) if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; @@ -7466,7 +7364,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __pyx_L10_bool_binop_done:; if (__pyx_t_5) { - /* "constraint/constraints.py":267 + /* "constraint/constraints.py":275 * return False * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: # <<<<<<<<<<<<<< @@ -7478,9 +7376,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -7488,17 +7386,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 275, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 275, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -7509,13 +7407,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 275, __pyx_L1_error) PyErr_Clear(); } break; @@ -7525,39 +7423,39 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":268 + /* "constraint/constraints.py":276 * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * if singlevalue not in domain: */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 276, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":269 + /* "constraint/constraints.py":277 * for variable in variables: * if variable not in assignments: * domain = domains[variable] # <<<<<<<<<<<<<< * if singlevalue not in domain: * return False */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":270 + /* "constraint/constraints.py":278 * if variable not in assignments: * domain = domains[variable] * if singlevalue not in domain: # <<<<<<<<<<<<<< * return False * for value in domain[:]: */ - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_singlevalue, __pyx_v_domain, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_singlevalue, __pyx_v_domain, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 278, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":271 + /* "constraint/constraints.py":279 * domain = domains[variable] * if singlevalue not in domain: * return False # <<<<<<<<<<<<<< @@ -7570,7 +7468,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":270 + /* "constraint/constraints.py":278 * if variable not in assignments: * domain = domains[variable] * if singlevalue not in domain: # <<<<<<<<<<<<<< @@ -7579,23 +7477,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":272 + /* "constraint/constraints.py":280 * if singlevalue not in domain: * return False * for value in domain[:]: # <<<<<<<<<<<<<< * if value != singlevalue: * domain.hideValue(value) */ - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_7 = __pyx_t_4; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 280, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -7604,17 +7502,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 272, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 280, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_8); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 272, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 280, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -7625,13 +7523,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 272, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 280, __pyx_L1_error) PyErr_Clear(); } break; @@ -7641,19 +7539,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":273 + /* "constraint/constraints.py":281 * return False * for value in domain[:]: * if value != singlevalue: # <<<<<<<<<<<<<< * domain.hideValue(value) * return True */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_value, __pyx_v_singlevalue, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_value, __pyx_v_singlevalue, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":274 + /* "constraint/constraints.py":282 * for value in domain[:]: * if value != singlevalue: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -7665,14 +7563,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":273 + /* "constraint/constraints.py":281 * return False * for value in domain[:]: * if value != singlevalue: # <<<<<<<<<<<<<< @@ -7681,7 +7579,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":272 + /* "constraint/constraints.py":280 * if singlevalue not in domain: * return False * for value in domain[:]: # <<<<<<<<<<<<<< @@ -7691,7 +7589,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":268 + /* "constraint/constraints.py":276 * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -7700,7 +7598,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":267 + /* "constraint/constraints.py":275 * return False * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: # <<<<<<<<<<<<<< @@ -7710,7 +7608,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":266 + /* "constraint/constraints.py":274 * elif value is not _unassigned and value != singlevalue: * return False * if forwardcheck and singlevalue is not _unassigned: # <<<<<<<<<<<<<< @@ -7719,7 +7617,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call */ } - /* "constraint/constraints.py":275 + /* "constraint/constraints.py":283 * if value != singlevalue: * domain.hideValue(value) * return True # <<<<<<<<<<<<<< @@ -7731,7 +7629,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":251 + /* "constraint/constraints.py":259 * """ * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< @@ -7757,10 +7655,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call return __pyx_r; } -/* "constraint/constraints.py":289 +/* "constraint/constraints.py":302 * """ * - * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, exactsum: int | float, multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -7807,41 +7705,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_exactsum,&__pyx_mstate_global->__pyx_n_u_multipliers,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 289, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 302, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 289, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 302, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 289, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 302, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 289, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 302, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 289, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 302, __pyx_L3_error) if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 289, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 302, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 289, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 302, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 289, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 302, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 289, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 302, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -7853,7 +7751,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 289, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 302, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7877,33 +7775,70 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_exactsum, PyObject *__pyx_v_multipliers) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":298 + /* "constraint/constraints.py":311 * summed to be checked * """ * self._exactsum = exactsum # <<<<<<<<<<<<<< * self._multipliers = multipliers - * + * self._var_max = {} */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactsum_2, __pyx_v_exactsum) < 0) __PYX_ERR(0, 298, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactsum_2, __pyx_v_exactsum) < (0)) __PYX_ERR(0, 311, __pyx_L1_error) - /* "constraint/constraints.py":299 + /* "constraint/constraints.py":312 * """ * self._exactsum = exactsum * self._multipliers = multipliers # <<<<<<<<<<<<<< + * self._var_max = {} + * self._var_min = {} +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < (0)) __PYX_ERR(0, 312, __pyx_L1_error) + + /* "constraint/constraints.py":313 + * self._exactsum = exactsum + * self._multipliers = multipliers + * self._var_max = {} # <<<<<<<<<<<<<< + * self._var_min = {} + * self._var_is_negative = {} +*/ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max, __pyx_t_1) < (0)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":314 + * self._multipliers = multipliers + * self._var_max = {} + * self._var_min = {} # <<<<<<<<<<<<<< + * self._var_is_negative = {} + * +*/ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min, __pyx_t_1) < (0)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":315 + * self._var_max = {} + * self._var_min = {} + * self._var_is_negative = {} # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 299, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative, __pyx_t_1) < (0)) __PYX_ERR(0, 315, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":289 + /* "constraint/constraints.py":302 * """ * - * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, exactsum: int | float, multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -7912,6 +7847,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("constraint.constraints.ExactSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -7920,12 +7856,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init return __pyx_r; } -/* "constraint/constraints.py":301 - * self._multipliers = multipliers +/* "constraint/constraints.py":317 + * self._var_is_negative = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * multipliers = self._multipliers + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) */ /* Python wrapper */ @@ -7971,50 +7907,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 301, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 317, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 301, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 317, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 301, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 317, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 301, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 317, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 301, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 317, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 301, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 317, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 301, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 317, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 301, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 317, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 301, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 317, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 301, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 317, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 301, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 317, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 301, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 317, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 301, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 317, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -8024,7 +7960,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 301, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 317, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8035,9 +7971,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 301, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 301, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 301, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 317, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 317, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 317, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_18ExactSumConstraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -8063,7 +7999,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr PyObject *__pyx_v_variable = NULL; PyObject *__pyx_v_multiplier = NULL; PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_other_vars_min = NULL; + PyObject *__pyx_v_other_vars_max = NULL; PyObject *__pyx_v_value = NULL; + PyObject *__pyx_7genexpr__pyx_v_variable = NULL; + PyObject *__pyx_7genexpr__pyx_v_multiplier = NULL; + PyObject *__pyx_8genexpr1__pyx_v_variable = NULL; + PyObject *__pyx_8genexpr1__pyx_v_multiplier = NULL; + PyObject *__pyx_8genexpr2__pyx_v_variable = NULL; + PyObject *__pyx_8genexpr2__pyx_v_multiplier = NULL; + PyObject *__pyx_8genexpr3__pyx_v_variable = NULL; + PyObject *__pyx_8genexpr3__pyx_v_multiplier = NULL; + PyObject *__pyx_8genexpr4__pyx_v_variable = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -8075,25 +8022,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr Py_ssize_t __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); PyObject *__pyx_t_9 = NULL; - PyObject *(*__pyx_t_10)(PyObject *); - Py_ssize_t __pyx_t_11; - PyObject *(*__pyx_t_12)(PyObject *); + PyObject *__pyx_t_10 = NULL; + PyObject *(*__pyx_t_11)(PyObject *); + Py_ssize_t __pyx_t_12; + PyObject *(*__pyx_t_13)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":302 + /* "constraint/constraints.py":318 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< - * multipliers = self._multipliers + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) * exactsum = self._exactsum */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -8110,548 +8058,1205 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":303 + /* "constraint/constraints.py":319 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * multipliers = self._multipliers # <<<<<<<<<<<<<< + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) # <<<<<<<<<<<<<< * exactsum = self._exactsum - * if multipliers: + * self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_7 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_4 = PyList_New(1 * ((__pyx_t_7<0) ? 0:__pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_t_7; __pyx_temp++) { + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 319, __pyx_L1_error); + } + } + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":304 + /* "constraint/constraints.py":320 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * multipliers = self._multipliers + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) * exactsum = self._exactsum # <<<<<<<<<<<<<< - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): + * self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exactsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":305 - * multipliers = self._multipliers - * exactsum = self._exactsum - * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * domain = domains[variable] -*/ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 305, __pyx_L1_error) - if (__pyx_t_6) { - - /* "constraint/constraints.py":306 + /* "constraint/constraints.py":321 + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) * exactsum = self._exactsum - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: + * self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< + * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + * */ - __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_2 = __pyx_builtin_zip; + { /* enter inner scope */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); } - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { + __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 321, __pyx_L5_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 306, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 321, __pyx_L5_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_7); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 306, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 321, __pyx_L5_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L5_error) } else { - __pyx_t_1 = __pyx_t_8(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { + __pyx_t_4 = __pyx_t_8(__pyx_t_2); + if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 306, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 321, __pyx_L5_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_1); - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 306, __pyx_L1_error) + __PYX_ERR(0, 321, __pyx_L5_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_4); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_3); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_9); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L5_error) __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 321, __pyx_L5_error) + __Pyx_XGOTREF(__pyx_t_9); } #else - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 321, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_9); #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; + __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 321, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 306, __pyx_L1_error) - __pyx_t_10 = NULL; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L7_unpacking_done; - __pyx_L6_unpacking_failed:; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_10 = NULL; + index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 321, __pyx_L5_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_unpacking_failed:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 306, __pyx_L1_error) - __pyx_L7_unpacking_done:; + __PYX_ERR(0, 321, __pyx_L5_error) + __pyx_L9_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_variable, __pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":307 - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): - * domain = domains[variable] # <<<<<<<<<<<<<< - * for value in domain[:]: - * if value * multiplier > exactsum: -*/ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":308 - * for variable, multiplier in zip(variables, multipliers): - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value * multiplier > exactsum: - * domain.remove(value) -*/ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); - __pyx_t_11 = 0; - __pyx_t_12 = NULL; - } else { - __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 308, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 308, __pyx_L1_error) - #endif - if (__pyx_t_11 >= __pyx_temp) break; - } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_11); - ++__pyx_t_11; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 308, __pyx_L1_error) - #endif - if (__pyx_t_11 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); - #endif - ++__pyx_t_11; - } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) - } else { - __pyx_t_1 = __pyx_t_12(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 308, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":309 - * domain = domains[variable] - * for value in domain[:]: - * if value * multiplier > exactsum: # <<<<<<<<<<<<<< - * domain.remove(value) - * else: -*/ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - - /* "constraint/constraints.py":310 - * for value in domain[:]: - * if value * multiplier > exactsum: - * domain.remove(value) # <<<<<<<<<<<<<< - * else: - * for variable in variables: -*/ - __pyx_t_1 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "constraint/constraints.py":309 - * domain = domains[variable] - * for value in domain[:]: - * if value * multiplier > exactsum: # <<<<<<<<<<<<<< - * domain.remove(value) - * else: -*/ - } - - /* "constraint/constraints.py":308 - * for variable, multiplier in zip(variables, multipliers): - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value * multiplier > exactsum: - * domain.remove(value) -*/ + __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_multiplier, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_7genexpr__pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_3}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); } + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_7genexpr__pyx_v_multiplier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_variable, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 321, __pyx_L5_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":306 - * exactsum = self._exactsum - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: -*/ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_multiplier); __pyx_7genexpr__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_variable); __pyx_7genexpr__pyx_v_variable = 0; + goto __pyx_L11_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_multiplier); __pyx_7genexpr__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_variable); __pyx_7genexpr__pyx_v_variable = 0; + goto __pyx_L1_error; + __pyx_L11_exit_scope:; + } /* exit inner scope */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min, __pyx_t_1) < (0)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":305 - * multipliers = self._multipliers + /* "constraint/constraints.py":322 * exactsum = self._exactsum - * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * domain = domains[variable] -*/ - goto __pyx_L3; - } - - /* "constraint/constraints.py":312 - * domain.remove(value) - * else: - * for variable in variables: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: + * self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< + * + * # preprocess the domains to remove values that cannot contribute to the exact sum */ - /*else*/ { - if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_2 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_2); + { /* enter inner scope */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + } + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 322, __pyx_L14_error) } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 322, __pyx_L14_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_7); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 322, __pyx_L14_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); + __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L14_error) } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_2); - if (unlikely(!__pyx_t_3)) { + __pyx_t_2 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 322, __pyx_L14_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":313 - * else: - * for variable in variables: - * domain = domains[variable] # <<<<<<<<<<<<<< - * for value in domain[:]: - * if value > exactsum: -*/ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":314 - * for variable in variables: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > exactsum: - * domain.remove(value) -*/ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); - __pyx_t_11 = 0; - __pyx_t_12 = NULL; + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 322, __pyx_L14_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_9); + } else { + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L14_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 322, __pyx_L14_error) + __Pyx_XGOTREF(__pyx_t_9); + } + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 322, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error) + Py_ssize_t index = -1; + __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 322, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + index = 0; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 314, __pyx_L1_error) + index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L17_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 322, __pyx_L14_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L18_unpacking_done; + __pyx_L17_unpacking_failed:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 322, __pyx_L14_error) + __pyx_L18_unpacking_done:; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 314, __pyx_L1_error) - #endif - if (__pyx_t_11 >= __pyx_temp) break; - } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_11); - ++__pyx_t_11; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 314, __pyx_L1_error) - #endif - if (__pyx_t_11 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11)); - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); - #endif - ++__pyx_t_11; - } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) - } else { - __pyx_t_3 = __pyx_t_12(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 314, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":315 - * domain = domains[variable] - * for value in domain[:]: - * if value > exactsum: # <<<<<<<<<<<<<< - * domain.remove(value) - * -*/ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 315, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { + __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_multiplier, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr1__pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_4}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_8genexpr1__pyx_v_multiplier); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L14_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr1__pyx_v_variable, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 322, __pyx_L14_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_multiplier); __pyx_8genexpr1__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_variable); __pyx_8genexpr1__pyx_v_variable = 0; + goto __pyx_L20_exit_scope; + __pyx_L14_error:; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_multiplier); __pyx_8genexpr1__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_variable); __pyx_8genexpr1__pyx_v_variable = 0; + goto __pyx_L1_error; + __pyx_L20_exit_scope:; + } /* exit inner scope */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max, __pyx_t_1) < (0)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":316 - * for value in domain[:]: - * if value > exactsum: - * domain.remove(value) # <<<<<<<<<<<<<< + /* "constraint/constraints.py":325 * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 + * # preprocess the domains to remove values that cannot contribute to the exact sum + * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< + * domain = domains[variable] + * other_vars_min = sum_other_vars(variables, variable, self._var_min) */ - __pyx_t_1 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 325, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 325, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_7; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 325, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_8(__pyx_t_3); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 325, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 325, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + } else { + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + } + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); + index = 0; __pyx_t_4 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L23_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_2 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L23_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L24_unpacking_done; + __pyx_L23_unpacking_failed:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_L24_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":315 - * domain = domains[variable] - * for value in domain[:]: - * if value > exactsum: # <<<<<<<<<<<<<< - * domain.remove(value) - * + /* "constraint/constraints.py":326 + * # preprocess the domains to remove values that cannot contribute to the exact sum + * for variable, multiplier in zip(variables, multipliers): + * domain = domains[variable] # <<<<<<<<<<<<<< + * other_vars_min = sum_other_vars(variables, variable, self._var_min) + * other_vars_max = sum_other_vars(variables, variable, self._var_max) */ - } + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":314 - * for variable in variables: - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > exactsum: - * domain.remove(value) + /* "constraint/constraints.py":327 + * for variable, multiplier in zip(variables, multipliers): + * domain = domains[variable] + * other_vars_min = sum_other_vars(variables, variable, self._var_min) # <<<<<<<<<<<<<< + * other_vars_max = sum_other_vars(variables, variable, self._var_max) + * for value in domain[:]: */ - } + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sum_other_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_variables, __pyx_v_variable, __pyx_t_9}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_other_vars_min, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":312 - * domain.remove(value) - * else: - * for variable in variables: # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: + /* "constraint/constraints.py":328 + * domain = domains[variable] + * other_vars_min = sum_other_vars(variables, variable, self._var_min) + * other_vars_max = sum_other_vars(variables, variable, self._var_max) # <<<<<<<<<<<<<< + * for value in domain[:]: + * if value * multiplier + other_vars_min > exactsum: */ + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_sum_other_vars); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); + __pyx_t_5 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_L3:; + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_variables, __pyx_v_variable, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_other_vars_max, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":301 - * self._multipliers = multipliers - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * multipliers = self._multipliers + /* "constraint/constraints.py":329 + * other_vars_min = sum_other_vars(variables, variable, self._var_min) + * other_vars_max = sum_other_vars(variables, variable, self._var_max) + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value * multiplier + other_vars_min > exactsum: + * domain.remove(value) */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("constraint.constraints.ExactSumConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_multipliers); - __Pyx_XDECREF(__pyx_v_exactsum); - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_multiplier); - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); + __pyx_t_12 = 0; + __pyx_t_13 = NULL; + } else { + __pyx_t_12 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 329, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 329, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_13)) { + if (likely(PyList_CheckExact(__pyx_t_9))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 329, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_12; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 329, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_12)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_12); + #endif + ++__pyx_t_12; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_13(__pyx_t_9); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 329, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":330 + * other_vars_max = sum_other_vars(variables, variable, self._var_max) + * for value in domain[:]: + * if value * multiplier + other_vars_min > exactsum: # <<<<<<<<<<<<<< + * domain.remove(value) + * if value * multiplier + other_vars_max < exactsum: +*/ + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_other_vars_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 330, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "constraint/constraints.py":331 + * for value in domain[:]: + * if value * multiplier + other_vars_min > exactsum: + * domain.remove(value) # <<<<<<<<<<<<<< + * if value * multiplier + other_vars_max < exactsum: + * domain.remove(value) +*/ + __pyx_t_2 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value}; + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":330 + * other_vars_max = sum_other_vars(variables, variable, self._var_max) + * for value in domain[:]: + * if value * multiplier + other_vars_min > exactsum: # <<<<<<<<<<<<<< + * domain.remove(value) + * if value * multiplier + other_vars_max < exactsum: +*/ + } + + /* "constraint/constraints.py":332 + * if value * multiplier + other_vars_min > exactsum: + * domain.remove(value) + * if value * multiplier + other_vars_max < exactsum: # <<<<<<<<<<<<<< + * domain.remove(value) + * +*/ + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_other_vars_max); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_exactsum, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 332, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "constraint/constraints.py":333 + * domain.remove(value) + * if value * multiplier + other_vars_max < exactsum: + * domain.remove(value) # <<<<<<<<<<<<<< + * + * # recalculate the min and max after pruning +*/ + __pyx_t_2 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_5 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value}; + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":332 + * if value * multiplier + other_vars_min > exactsum: + * domain.remove(value) + * if value * multiplier + other_vars_max < exactsum: # <<<<<<<<<<<<<< + * domain.remove(value) + * +*/ + } + + /* "constraint/constraints.py":329 + * other_vars_min = sum_other_vars(variables, variable, self._var_min) + * other_vars_max = sum_other_vars(variables, variable, self._var_max) + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value * multiplier + other_vars_min > exactsum: + * domain.remove(value) +*/ + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + + /* "constraint/constraints.py":325 + * + * # preprocess the domains to remove values that cannot contribute to the exact sum + * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< + * domain = domains[variable] + * other_vars_min = sum_other_vars(variables, variable, self._var_min) +*/ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":336 + * + * # recalculate the min and max after pruning + * self._var_max = { variable: max(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< + * self._var_min = { variable: min(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + * self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } +*/ + { /* enter inner scope */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = NULL; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_9); + } + if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_1 = __pyx_t_9; __Pyx_INCREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 336, __pyx_L33_error) + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 336, __pyx_L33_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_7; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 336, __pyx_L33_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7)); + #else + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 336, __pyx_L33_error) + } else { + __pyx_t_9 = __pyx_t_8(__pyx_t_1); + if (unlikely(!__pyx_t_9)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 336, __pyx_L33_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_9); + if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) { + PyObject* sequence = __pyx_t_9; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 336, __pyx_L33_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + } else { + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_XGOTREF(__pyx_t_4); + } + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L36_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L36_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 336, __pyx_L33_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L37_unpacking_done; + __pyx_L36_unpacking_failed:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 336, __pyx_L33_error) + __pyx_L37_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_variable, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_multiplier, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr2__pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_12 > 0); + if (__pyx_t_6) { + __pyx_t_2 = NULL; + __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr2__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_10}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_t_10 = PyNumber_Multiply(__pyx_t_4, __pyx_8genexpr2__pyx_v_multiplier); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_t_9 = __pyx_mstate_global->__pyx_int_0; + } + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr2__pyx_v_variable, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 336, __pyx_L33_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_multiplier); __pyx_8genexpr2__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_variable); __pyx_8genexpr2__pyx_v_variable = 0; + goto __pyx_L39_exit_scope; + __pyx_L33_error:; + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_multiplier); __pyx_8genexpr2__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_variable); __pyx_8genexpr2__pyx_v_variable = 0; + goto __pyx_L1_error; + __pyx_L39_exit_scope:; + } /* exit inner scope */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max, __pyx_t_3) < (0)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":337 + * # recalculate the min and max after pruning + * self._var_max = { variable: max(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + * self._var_min = { variable: min(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< + * self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } + * +*/ + { /* enter inner scope */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = NULL; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_1); + } + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L42_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_9))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 337, __pyx_L42_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_7; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 337, __pyx_L42_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L42_error) + } else { + __pyx_t_1 = __pyx_t_8(__pyx_t_9); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 337, __pyx_L42_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 337, __pyx_L42_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_10); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + } else { + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_XGOTREF(__pyx_t_4); + } + #else + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); + index = 0; __pyx_t_10 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_10)) goto __pyx_L45_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L45_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_2), 2) < (0)) __PYX_ERR(0, 337, __pyx_L42_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L46_unpacking_done; + __pyx_L45_unpacking_failed:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 337, __pyx_L42_error) + __pyx_L46_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_variable, __pyx_t_10); + __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_multiplier, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr3__pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_12 > 0); + if (__pyx_t_6) { + __pyx_t_10 = NULL; + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr3__pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_2}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_8genexpr3__pyx_v_multiplier); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_t_1 = __pyx_mstate_global->__pyx_int_0; + } + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr3__pyx_v_variable, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 337, __pyx_L42_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_multiplier); __pyx_8genexpr3__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_variable); __pyx_8genexpr3__pyx_v_variable = 0; + goto __pyx_L48_exit_scope; + __pyx_L42_error:; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_multiplier); __pyx_8genexpr3__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_variable); __pyx_8genexpr3__pyx_v_variable = 0; + goto __pyx_L1_error; + __pyx_L48_exit_scope:; + } /* exit inner scope */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min, __pyx_t_3) < (0)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":338 + * self._var_max = { variable: max(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + * self._var_min = { variable: min(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + * self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } # <<<<<<<<<<<<<< + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 +*/ + { /* enter inner scope */ + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L51_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { + __pyx_t_9 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_9); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 338, __pyx_L51_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 338, __pyx_L51_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_9))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 338, __pyx_L51_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_7; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 338, __pyx_L51_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L51_error) + } else { + __pyx_t_1 = __pyx_t_8(__pyx_t_9); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 338, __pyx_L51_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L51_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_8genexpr4__pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L51_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L51_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_8genexpr4__pyx_v_variable, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 338, __pyx_L51_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_variable); __pyx_8genexpr4__pyx_v_variable = 0; + goto __pyx_L55_exit_scope; + __pyx_L51_error:; + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_variable); __pyx_8genexpr4__pyx_v_variable = 0; + goto __pyx_L1_error; + __pyx_L55_exit_scope:; + } /* exit inner scope */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative, __pyx_t_3) < (0)) __PYX_ERR(0, 338, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":317 + * self._var_is_negative = {} + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) +*/ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("constraint.constraints.ExactSumConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_multipliers); + __Pyx_XDECREF(__pyx_v_exactsum); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_multiplier); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_other_vars_min); + __Pyx_XDECREF(__pyx_v_other_vars_max); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_variable); + __Pyx_XDECREF(__pyx_7genexpr__pyx_v_multiplier); + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_variable); + __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_multiplier); + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_variable); + __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_multiplier); + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_variable); + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_multiplier); + __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_variable); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":318 - * domain.remove(value) +/* "constraint/constraints.py":340 + * self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers @@ -8701,53 +9306,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 318, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 340, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 318, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 340, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 318, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 340, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 318, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 340, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 318, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 340, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 318, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 340, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 318, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 340, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 318, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 340, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 318, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 340, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 318, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 340, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 318, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 340, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 318, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 340, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 318, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 340, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -8761,7 +9366,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 318, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 340, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8772,8 +9377,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 318, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 318, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 340, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 340, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -8797,7 +9402,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal PyObject *__pyx_v_multipliers = NULL; PyObject *__pyx_v_exactsum = NULL; PyObject *__pyx_v_sum = NULL; + PyObject *__pyx_v_min_sum_missing = NULL; + PyObject *__pyx_v_max_sum_missing = NULL; int __pyx_v_missing; + int __pyx_v_missing_negative; PyObject *__pyx_v_variable = NULL; PyObject *__pyx_v_multiplier = NULL; PyObject *__pyx_v_domain = NULL; @@ -8807,10 +9415,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); + size_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); @@ -8822,122 +9430,148 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":319 + /* "constraint/constraints.py":341 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers # <<<<<<<<<<<<<< * exactsum = self._exactsum * sum = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":320 + /* "constraint/constraints.py":342 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers * exactsum = self._exactsum # <<<<<<<<<<<<<< * sum = 0 - * missing = False + * min_sum_missing = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exactsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":321 + /* "constraint/constraints.py":343 * multipliers = self._multipliers * exactsum = self._exactsum * sum = 0 # <<<<<<<<<<<<<< - * missing = False - * if multipliers: + * min_sum_missing = 0 + * max_sum_missing = 0 */ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":322 + /* "constraint/constraints.py":344 * exactsum = self._exactsum * sum = 0 + * min_sum_missing = 0 # <<<<<<<<<<<<<< + * max_sum_missing = 0 + * missing = False +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_min_sum_missing = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":345 + * sum = 0 + * min_sum_missing = 0 + * max_sum_missing = 0 # <<<<<<<<<<<<<< + * missing = False + * missing_negative = False +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_max_sum_missing = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":346 + * min_sum_missing = 0 + * max_sum_missing = 0 * missing = False # <<<<<<<<<<<<<< + * missing_negative = False * if multipliers: - * for variable, multiplier in zip(variables, multipliers): */ __pyx_v_missing = 0; - /* "constraint/constraints.py":323 - * sum = 0 + /* "constraint/constraints.py":347 + * max_sum_missing = 0 + * missing = False + * missing_negative = False # <<<<<<<<<<<<<< + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): +*/ + __pyx_v_missing_negative = 0; + + /* "constraint/constraints.py":348 * missing = False + * missing_negative = False * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":324 - * missing = False + /* "constraint/constraints.py":349 + * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] * multiplier */ __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_4 = __pyx_builtin_zip; - __pyx_t_5 = 1; + __pyx_t_4 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 349, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 324, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 349, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 324, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 349, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); #endif - ++__pyx_t_6; + ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_4); + __pyx_t_1 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 324, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 349, __pyx_L1_error) PyErr_Clear(); } break; @@ -8950,40 +9584,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 324, __pyx_L1_error) + __PYX_ERR(0, 349, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); + index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 324, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 349, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -8991,43 +9625,43 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 324, __pyx_L1_error) + __PYX_ERR(0, 349, __pyx_L1_error) __pyx_L7_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); + __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":325 + /* "constraint/constraints.py":350 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier * else: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 350, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":326 + /* "constraint/constraints.py":351 * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< * else: - * missing = True + * min_sum_missing += self._var_min[variable] */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":325 + /* "constraint/constraints.py":350 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< @@ -9037,86 +9671,169 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal goto __pyx_L8; } - /* "constraint/constraints.py":328 + /* "constraint/constraints.py":353 * sum += assignments[variable] * multiplier * else: + * min_sum_missing += self._var_min[variable] # <<<<<<<<<<<<<< + * max_sum_missing += self._var_max[variable] + * missing = True +*/ + /*else*/ { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_min_sum_missing, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_min_sum_missing, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":354 + * else: + * min_sum_missing += self._var_min[variable] + * max_sum_missing += self._var_max[variable] # <<<<<<<<<<<<<< + * missing = True + * if self._var_is_negative[variable]: +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_max_sum_missing, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_max_sum_missing, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":355 + * min_sum_missing += self._var_min[variable] + * max_sum_missing += self._var_max[variable] * missing = True # <<<<<<<<<<<<<< + * if self._var_is_negative[variable]: + * missing_negative = True +*/ + __pyx_v_missing = 1; + + /* "constraint/constraints.py":356 + * max_sum_missing += self._var_max[variable] + * missing = True + * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< + * missing_negative = True + * if isinstance(sum, float): +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":357 + * missing = True + * if self._var_is_negative[variable]: + * missing_negative = True # <<<<<<<<<<<<<< * if isinstance(sum, float): * sum = round(sum, 10) */ - /*else*/ { - __pyx_v_missing = 1; + __pyx_v_missing_negative = 1; + + /* "constraint/constraints.py":356 + * max_sum_missing += self._var_max[variable] + * missing = True + * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< + * missing_negative = True + * if isinstance(sum, float): +*/ + } } __pyx_L8:; - /* "constraint/constraints.py":324 - * missing = False + /* "constraint/constraints.py":349 + * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] * multiplier */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":329 - * else: - * missing = True + /* "constraint/constraints.py":358 + * if self._var_is_negative[variable]: + * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * if sum > exactsum: + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: */ __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { - /* "constraint/constraints.py":330 - * missing = True + /* "constraint/constraints.py":359 + * missing_negative = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< - * if sum > exactsum: + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False */ - __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_8 = __pyx_builtin_round; - __pyx_t_5 = 1; + __pyx_t_8 = NULL; + __pyx_t_4 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":329 - * else: - * missing = True + /* "constraint/constraints.py":358 + * if self._var_is_negative[variable]: + * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * if sum > exactsum: + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: */ } - /* "constraint/constraints.py":331 + /* "constraint/constraints.py":360 * if isinstance(sum, float): * sum = round(sum, 10) - * if sum > exactsum: # <<<<<<<<<<<<<< + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: # <<<<<<<<<<<<<< * return False - * if forwardcheck and missing: + * if forwardcheck and missing and not missing_negative: */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 331, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (!__pyx_t_11) { + } else { + __pyx_t_2 = __pyx_t_11; + goto __pyx_L13_bool_binop_done; + } + __pyx_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_8, __pyx_v_exactsum, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __pyx_t_11; + __pyx_L13_bool_binop_done:; if (__pyx_t_2) { - /* "constraint/constraints.py":332 + /* "constraint/constraints.py":361 * sum = round(sum, 10) - * if sum > exactsum: + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False # <<<<<<<<<<<<<< - * if forwardcheck and missing: + * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): */ __Pyx_XDECREF(__pyx_r); @@ -9124,278 +9841,281 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":331 + /* "constraint/constraints.py":360 * if isinstance(sum, float): * sum = round(sum, 10) - * if sum > exactsum: # <<<<<<<<<<<<<< + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: # <<<<<<<<<<<<<< * return False - * if forwardcheck and missing: + * if forwardcheck and missing and not missing_negative: */ } - /* "constraint/constraints.py":333 - * if sum > exactsum: + /* "constraint/constraints.py":362 + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False - * if forwardcheck and missing: # <<<<<<<<<<<<<< + * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 362, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_2 = __pyx_t_11; - goto __pyx_L13_bool_binop_done; + goto __pyx_L16_bool_binop_done; } - __pyx_t_2 = __pyx_v_missing; - __pyx_L13_bool_binop_done:; + if (__pyx_v_missing) { + } else { + __pyx_t_2 = __pyx_v_missing; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_11 = (!__pyx_v_missing_negative); + __pyx_t_2 = __pyx_t_11; + __pyx_L16_bool_binop_done:; if (__pyx_t_2) { - /* "constraint/constraints.py":334 + /* "constraint/constraints.py":363 * return False - * if forwardcheck and missing: + * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] */ __pyx_t_8 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_1 = __pyx_builtin_zip; - __pyx_t_5 = 1; + __pyx_t_4 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 363, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_8))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 334, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 363, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 334, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 363, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_5); #endif - ++__pyx_t_6; + ++__pyx_t_5; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { + __pyx_t_3 = __pyx_t_6(__pyx_t_8); + if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 334, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 363, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_4); - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; + __Pyx_GOTREF(__pyx_t_3); + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 334, __pyx_L1_error) + __PYX_ERR(0, 363, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_8); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); } #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L17_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L17_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 334, __pyx_L1_error) + index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L21_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 363, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L18_unpacking_done; - __pyx_L17_unpacking_failed:; + goto __pyx_L22_unpacking_done; + __pyx_L21_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 334, __pyx_L1_error) - __pyx_L18_unpacking_done:; + __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_L22_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":335 - * if forwardcheck and missing: + /* "constraint/constraints.py":364 + * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 364, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":336 + /* "constraint/constraints.py":365 * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if sum + value * multiplier > exactsum: */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":337 + /* "constraint/constraints.py":366 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value * multiplier > exactsum: * domain.hideValue(value) */ - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_7 = __pyx_t_3; __Pyx_INCREF(__pyx_t_7); __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 366, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 366, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 366, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_12); #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_13(__pyx_t_3); - if (unlikely(!__pyx_t_4)) { + __pyx_t_3 = __pyx_t_13(__pyx_t_7); + if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 366, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":338 + /* "constraint/constraints.py":367 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_4 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 338, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyNumber_Add(__pyx_v_sum, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 367, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":339 + /* "constraint/constraints.py":368 * for value in domain[:]: * if sum + value * multiplier > exactsum: * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False */ - __pyx_t_8 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_8); - __pyx_t_5 = 0; + __pyx_t_1 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 339, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":338 + /* "constraint/constraints.py":367 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< @@ -9404,7 +10124,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":337 + /* "constraint/constraints.py":366 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -9412,20 +10132,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * domain.hideValue(value) */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":340 + /* "constraint/constraints.py":369 * if sum + value * multiplier > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 369, __pyx_L1_error) __pyx_t_11 = (!__pyx_t_2); if (__pyx_t_11) { - /* "constraint/constraints.py":341 + /* "constraint/constraints.py":370 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -9435,10 +10155,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L0; - /* "constraint/constraints.py":340 + /* "constraint/constraints.py":369 * if sum + value * multiplier > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -9447,8 +10167,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":335 - * if forwardcheck and missing: + /* "constraint/constraints.py":364 + * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] @@ -9456,28 +10176,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":334 + /* "constraint/constraints.py":363 * return False - * if forwardcheck and missing: + * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":333 - * if sum > exactsum: + /* "constraint/constraints.py":362 + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False - * if forwardcheck and missing: # <<<<<<<<<<<<<< + * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: */ } - /* "constraint/constraints.py":323 - * sum = 0 + /* "constraint/constraints.py":348 * missing = False + * missing_negative = False * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: @@ -9485,7 +10205,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal goto __pyx_L3; } - /* "constraint/constraints.py":343 + /* "constraint/constraints.py":372 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -9494,105 +10214,175 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + __pyx_t_8 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_8); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_8))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 343, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 372, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 343, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 372, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_5); #endif - ++__pyx_t_6; + ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_7 = __pyx_t_6(__pyx_t_8); + if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 343, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 372, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":344 + /* "constraint/constraints.py":373 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * else: */ - __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 373, __pyx_L1_error) if (__pyx_t_11) { - /* "constraint/constraints.py":345 + /* "constraint/constraints.py":374 * for variable in variables: * if variable in assignments: * sum += assignments[variable] # <<<<<<<<<<<<<< * else: - * missing = True + * min_sum_missing += self._var_min[variable] */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":344 + /* "constraint/constraints.py":373 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * else: */ - goto __pyx_L28; + goto __pyx_L32; } - /* "constraint/constraints.py":347 + /* "constraint/constraints.py":376 * sum += assignments[variable] * else: + * min_sum_missing += self._var_min[variable] # <<<<<<<<<<<<<< + * max_sum_missing += self._var_max[variable] + * missing = True +*/ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_min_sum_missing, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_min_sum_missing, __pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/constraints.py":377 + * else: + * min_sum_missing += self._var_min[variable] + * max_sum_missing += self._var_max[variable] # <<<<<<<<<<<<<< + * missing = True + * if self._var_is_negative[variable]: +*/ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_max_sum_missing, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_max_sum_missing, __pyx_t_3); + __pyx_t_3 = 0; + + /* "constraint/constraints.py":378 + * min_sum_missing += self._var_min[variable] + * max_sum_missing += self._var_max[variable] * missing = True # <<<<<<<<<<<<<< + * if self._var_is_negative[variable]: + * missing_negative = True +*/ + __pyx_v_missing = 1; + + /* "constraint/constraints.py":379 + * max_sum_missing += self._var_max[variable] + * missing = True + * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< + * missing_negative = True + * if isinstance(sum, float): +*/ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_11) { + + /* "constraint/constraints.py":380 + * missing = True + * if self._var_is_negative[variable]: + * missing_negative = True # <<<<<<<<<<<<<< * if isinstance(sum, float): * sum = round(sum, 10) */ - /*else*/ { - __pyx_v_missing = 1; + __pyx_v_missing_negative = 1; + + /* "constraint/constraints.py":379 + * max_sum_missing += self._var_max[variable] + * missing = True + * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< + * missing_negative = True + * if isinstance(sum, float): +*/ + } } - __pyx_L28:; + __pyx_L32:; - /* "constraint/constraints.py":343 + /* "constraint/constraints.py":372 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -9600,66 +10390,79 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * sum += assignments[variable] */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":348 - * else: - * missing = True + /* "constraint/constraints.py":381 + * if self._var_is_negative[variable]: + * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * if sum > exactsum: + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: */ __pyx_t_11 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_11) { - /* "constraint/constraints.py":349 - * missing = True + /* "constraint/constraints.py":382 + * missing_negative = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< - * if sum > exactsum: + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False */ - __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_3 = __pyx_builtin_round; - __pyx_t_5 = 1; + __pyx_t_7 = NULL; + __pyx_t_4 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":348 - * else: - * missing = True + /* "constraint/constraints.py":381 + * if self._var_is_negative[variable]: + * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * if sum > exactsum: + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: */ } - /* "constraint/constraints.py":350 + /* "constraint/constraints.py":383 * if isinstance(sum, float): * sum = round(sum, 10) - * if sum > exactsum: # <<<<<<<<<<<<<< + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: # <<<<<<<<<<<<<< * return False - * if forwardcheck and missing: + * if forwardcheck and missing and not missing_negative: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 350, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (!__pyx_t_2) { + } else { + __pyx_t_11 = __pyx_t_2; + goto __pyx_L37_bool_binop_done; + } + __pyx_t_7 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_v_exactsum, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __pyx_t_2; + __pyx_L37_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":351 + /* "constraint/constraints.py":384 * sum = round(sum, 10) - * if sum > exactsum: + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False # <<<<<<<<<<<<<< - * if forwardcheck and missing: + * if forwardcheck and missing and not missing_negative: * for variable in variables: */ __Pyx_XDECREF(__pyx_r); @@ -9667,210 +10470,216 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":350 + /* "constraint/constraints.py":383 * if isinstance(sum, float): * sum = round(sum, 10) - * if sum > exactsum: # <<<<<<<<<<<<<< + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: # <<<<<<<<<<<<<< * return False - * if forwardcheck and missing: + * if forwardcheck and missing and not missing_negative: */ } - /* "constraint/constraints.py":352 - * if sum > exactsum: + /* "constraint/constraints.py":385 + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False - * if forwardcheck and missing: # <<<<<<<<<<<<<< + * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 385, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_11 = __pyx_t_2; - goto __pyx_L33_bool_binop_done; + goto __pyx_L40_bool_binop_done; + } + if (__pyx_v_missing) { + } else { + __pyx_t_11 = __pyx_v_missing; + goto __pyx_L40_bool_binop_done; } - __pyx_t_11 = __pyx_v_missing; - __pyx_L33_bool_binop_done:; + __pyx_t_2 = (!__pyx_v_missing_negative); + __pyx_t_11 = __pyx_t_2; + __pyx_L40_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":353 + /* "constraint/constraints.py":386 * return False - * if forwardcheck and missing: + * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] */ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + __pyx_t_8 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_8); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_8))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 353, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 386, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 353, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 386, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_5); #endif - ++__pyx_t_6; + ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_7 = __pyx_t_6(__pyx_t_8); + if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 353, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 386, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":354 - * if forwardcheck and missing: + /* "constraint/constraints.py":387 + * if forwardcheck and missing and not missing_negative: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: */ - __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 387, __pyx_L1_error) if (__pyx_t_11) { - /* "constraint/constraints.py":355 + /* "constraint/constraints.py":388 * for variable in variables: * if variable not in assignments: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if sum + value > exactsum: */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":356 + /* "constraint/constraints.py":389 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value > exactsum: * domain.hideValue(value) */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_3 = __pyx_t_7; __Pyx_INCREF(__pyx_t_3); __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 389, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 356, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 389, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_12); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 356, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 389, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_12)); + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_12); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_13(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { + __pyx_t_7 = __pyx_t_13(__pyx_t_3); + if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 356, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 389, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":357 + /* "constraint/constraints.py":390 * domain = domains[variable] * for value in domain[:]: * if sum + value > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 357, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 357, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 390, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 390, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":358 + /* "constraint/constraints.py":391 * for value in domain[:]: * if sum + value > exactsum: * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_5 = 0; + __pyx_t_7 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_7); + __pyx_t_4 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 358, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_value}; + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":357 + /* "constraint/constraints.py":390 * domain = domains[variable] * for value in domain[:]: * if sum + value > exactsum: # <<<<<<<<<<<<<< @@ -9879,7 +10688,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":356 + /* "constraint/constraints.py":389 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -9887,33 +10696,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * domain.hideValue(value) */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":359 + /* "constraint/constraints.py":392 * if sum + value > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * if missing: */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 392, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_11); if (__pyx_t_2) { - /* "constraint/constraints.py":360 + /* "constraint/constraints.py":393 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< * if missing: - * return sum <= exactsum + * return sum + min_sum_missing <= exactsum and sum + max_sum_missing >= exactsum */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L0; - /* "constraint/constraints.py":359 + /* "constraint/constraints.py":392 * if sum + value > exactsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -9922,8 +10731,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":354 - * if forwardcheck and missing: + /* "constraint/constraints.py":387 + * if forwardcheck and missing and not missing_negative: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] @@ -9931,20 +10740,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ } - /* "constraint/constraints.py":353 + /* "constraint/constraints.py":386 * return False - * if forwardcheck and missing: + * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":352 - * if sum > exactsum: + /* "constraint/constraints.py":385 + * if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: * return False - * if forwardcheck and missing: # <<<<<<<<<<<<<< + * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: */ @@ -9952,39 +10761,59 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } __pyx_L3:; - /* "constraint/constraints.py":361 + /* "constraint/constraints.py":394 * if not domain: * return False * if missing: # <<<<<<<<<<<<<< - * return sum <= exactsum + * return sum + min_sum_missing <= exactsum and sum + max_sum_missing >= exactsum * else: */ if (__pyx_v_missing) { - /* "constraint/constraints.py":362 + /* "constraint/constraints.py":395 * return False * if missing: - * return sum <= exactsum # <<<<<<<<<<<<<< + * return sum + min_sum_missing <= exactsum and sum + max_sum_missing >= exactsum # <<<<<<<<<<<<<< * else: * return sum == exactsum */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_exactsum, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_exactsum, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 395, __pyx_L1_error) + if (__pyx_t_2) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_8 = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L53_bool_binop_done; + } + __pyx_t_1 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_exactsum, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_8 = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_L53_bool_binop_done:; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; goto __pyx_L0; - /* "constraint/constraints.py":361 + /* "constraint/constraints.py":394 * if not domain: * return False * if missing: # <<<<<<<<<<<<<< - * return sum <= exactsum + * return sum + min_sum_missing <= exactsum and sum + max_sum_missing >= exactsum * else: */ } - /* "constraint/constraints.py":364 - * return sum <= exactsum + /* "constraint/constraints.py":397 + * return sum + min_sum_missing <= exactsum and sum + max_sum_missing >= exactsum * else: * return sum == exactsum # <<<<<<<<<<<<<< * @@ -9992,14 +10821,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_exactsum, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_exactsum, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; goto __pyx_L0; } - /* "constraint/constraints.py":318 - * domain.remove(value) + /* "constraint/constraints.py":340 + * self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers @@ -10010,7 +10839,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("constraint.constraints.ExactSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -10019,6 +10848,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __Pyx_XDECREF(__pyx_v_multipliers); __Pyx_XDECREF(__pyx_v_exactsum); __Pyx_XDECREF(__pyx_v_sum); + __Pyx_XDECREF(__pyx_v_min_sum_missing); + __Pyx_XDECREF(__pyx_v_max_sum_missing); __Pyx_XDECREF(__pyx_v_variable); __Pyx_XDECREF(__pyx_v_multiplier); __Pyx_XDECREF(__pyx_v_domain); @@ -10028,10 +10859,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal return __pyx_r; } -/* "constraint/constraints.py":377 - * """ +/* "constraint/constraints.py":417 + * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -10079,47 +10910,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_target_var,&__pyx_mstate_global->__pyx_n_u_sum_vars,&__pyx_mstate_global->__pyx_n_u_multipliers,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 377, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 417, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 377, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 417, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 377, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 417, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 377, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 417, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 377, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 417, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 377, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 417, __pyx_L3_error) if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 377, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 417, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 377, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 417, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 377, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 417, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 377, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 417, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 377, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 417, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -10132,7 +10963,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 377, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 417, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10143,7 +10974,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 377, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 417, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_26VariableExactSumConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_target_var, __pyx_v_sum_vars, __pyx_v_multipliers); /* function exit code */ @@ -10164,7 +10995,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_8__init___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":393 +/* "constraint/constraints.py":433 * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." # <<<<<<<<<<<<<< @@ -10184,7 +11015,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 393, __pyx_L1_error) + __PYX_ERR(0, 433, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10192,7 +11023,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_8__init___2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint___ini, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_8__init___2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint___ini, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10230,16 +11061,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 393, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 393, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 433, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 433, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -10247,17 +11078,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 393, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 433, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 393, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 433, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -10268,13 +11099,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 393, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 433, __pyx_L1_error) PyErr_Clear(); } break; @@ -10332,10 +11163,10 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":377 - * """ +/* "constraint/constraints.py":417 + * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -10354,44 +11185,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":387 + /* "constraint/constraints.py":427 * summed to match the last variable. * """ * self.target_var = target_var # <<<<<<<<<<<<<< * self.sum_vars = sum_vars * self._multipliers = multipliers */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < (0)) __PYX_ERR(0, 427, __pyx_L1_error) - /* "constraint/constraints.py":388 + /* "constraint/constraints.py":428 * """ * self.target_var = target_var * self.sum_vars = sum_vars # <<<<<<<<<<<<<< * self._multipliers = multipliers * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_v_sum_vars) < 0) __PYX_ERR(0, 388, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_v_sum_vars) < (0)) __PYX_ERR(0, 428, __pyx_L1_error) - /* "constraint/constraints.py":389 + /* "constraint/constraints.py":429 * self.target_var = target_var * self.sum_vars = sum_vars * self._multipliers = multipliers # <<<<<<<<<<<<<< * * if multipliers: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 389, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < (0)) __PYX_ERR(0, 429, __pyx_L1_error) - /* "constraint/constraints.py":391 + /* "constraint/constraints.py":431 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 431, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/constraints.py":392 + /* "constraint/constraints.py":432 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -10400,19 +11231,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_2 = PyObject_Length(__pyx_v_multipliers); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 392, __pyx_L1_error) - __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_v_multipliers); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 432, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 == (__pyx_t_3 + 1)); if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_Multipliers_must_match_sum_varia, 0, 0); - __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_match_sum_varia, 0, 0); + __PYX_ERR(0, 432, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 392, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 432, __pyx_L1_error) #endif - /* "constraint/constraints.py":393 + /* "constraint/constraints.py":433 * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." # <<<<<<<<<<<<<< @@ -10421,23 +11252,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_4 = __pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_8__init___genexpr(NULL, __pyx_v_multipliers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_8__init___genexpr(NULL, __pyx_v_multipliers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_Multipliers_must_be_numbers, 0, 0); - __PYX_ERR(0, 393, __pyx_L1_error) + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_be_numbers, 0, 0); + __PYX_ERR(0, 433, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 393, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 433, __pyx_L1_error) #endif - /* "constraint/constraints.py":394 + /* "constraint/constraints.py":434 * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." # <<<<<<<<<<<<<< @@ -10446,20 +11277,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_multipliers, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_multipliers, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_Last_multiplier_must_be_1_as_it, 0, 0); - __PYX_ERR(0, 394, __pyx_L1_error) + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Last_multiplier_must_be_1_as_it, 0, 0); + __PYX_ERR(0, 434, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 394, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 434, __pyx_L1_error) #endif - /* "constraint/constraints.py":391 + /* "constraint/constraints.py":431 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -10468,10 +11299,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":377 - * """ + /* "constraint/constraints.py":417 + * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -10491,7 +11322,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":396 +/* "constraint/constraints.py":436 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -10542,50 +11373,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 396, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 436, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 396, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 436, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 396, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 436, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 396, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 436, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 396, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 436, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 396, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 436, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 396, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 436, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 396, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 436, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 396, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 436, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 396, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 436, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 396, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 436, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 396, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 436, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 396, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 436, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -10595,7 +11426,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 396, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 436, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10606,9 +11437,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 396, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 396, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 396, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 436, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 436, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 436, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -10629,7 +11460,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":410 +/* "constraint/constraints.py":450 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -10649,7 +11480,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 410, __pyx_L1_error) + __PYX_ERR(0, 450, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10660,7 +11491,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_2generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint_prePr, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_2generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint_prePr, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10687,8 +11518,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - size_t __pyx_t_9; + size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -10704,17 +11534,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __pyx_L3_first_run:; if (unlikely(__pyx_sent_value != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); - __PYX_ERR(0, 410, __pyx_L1_error) + __PYX_ERR(0, 450, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 410, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 450, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -10722,17 +11552,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 410, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 450, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 410, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 450, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -10743,13 +11573,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 410, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 450, __pyx_L1_error) PyErr_Clear(); } break; @@ -10760,29 +11590,26 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 410, __pyx_L1_error) } - __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_v, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 410, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 450, __pyx_L1_error) } + __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_v, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __pyx_t_6 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_7 = __pyx_builtin_min; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 410, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 450, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 410, __pyx_L1_error) + __PYX_ERR(0, 450, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_v); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = 1; + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 410, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -10803,7 +11630,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 410, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 450, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10817,7 +11644,6 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -10834,7 +11660,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain } static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":411 +/* "constraint/constraints.py":451 * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -10854,7 +11680,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 411, __pyx_L1_error) + __PYX_ERR(0, 451, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10865,7 +11691,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_5generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint_prePr, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_5generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint_prePr, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10892,8 +11718,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - size_t __pyx_t_9; + size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -10909,17 +11734,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __pyx_L3_first_run:; if (unlikely(__pyx_sent_value != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); - __PYX_ERR(0, 411, __pyx_L1_error) + __PYX_ERR(0, 451, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 411, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 451, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -10927,17 +11752,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 411, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 451, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 411, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 451, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -10948,13 +11773,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 411, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 411, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 451, __pyx_L1_error) PyErr_Clear(); } break; @@ -10965,29 +11790,26 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 411, __pyx_L1_error) } - __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_v, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 411, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 411, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 451, __pyx_L1_error) } + __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_v, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __pyx_t_6 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_7 = __pyx_builtin_max; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 411, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 451, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 411, __pyx_L1_error) + __PYX_ERR(0, 451, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_v); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = 1; + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 411, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -11008,7 +11830,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 411, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 451, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11022,7 +11844,6 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -11038,7 +11859,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":396 +/* "constraint/constraints.py":436 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -11072,7 +11893,6 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain PyObject *(*__pyx_t_12)(PyObject *); PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -11081,7 +11901,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 396, __pyx_L1_error) + __PYX_ERR(0, 436, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -11089,7 +11909,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_INCREF(__pyx_cur_scope->__pyx_v_domains); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_domains); - /* "constraint/constraints.py":397 + /* "constraint/constraints.py":437 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -11097,9 +11917,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * multipliers = self._multipliers */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -11116,37 +11936,37 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_self, __pyx_v_variables, __pyx_cur_scope->__pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":399 + /* "constraint/constraints.py":439 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * * multipliers = self._multipliers # <<<<<<<<<<<<<< * * if multipliers: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":401 + /* "constraint/constraints.py":441 * multipliers = self._multipliers * * if multipliers: # <<<<<<<<<<<<<< * for var, multiplier in zip(self.sum_vars, multipliers): * domain = domains[var] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 441, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/constraints.py":402 + /* "constraint/constraints.py":442 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -11154,18 +11974,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * for value in domain[:]: */ __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_2 = __pyx_builtin_zip; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_multipliers}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_multipliers}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -11173,9 +11990,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 442, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -11184,17 +12001,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 402, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 442, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_7); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 402, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 442, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } @@ -11205,13 +12022,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_8(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 402, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 442, __pyx_L1_error) PyErr_Clear(); } break; @@ -11224,40 +12041,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 402, __pyx_L1_error) + __PYX_ERR(0, 442, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; + index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 402, __pyx_L1_error) + index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 442, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -11265,81 +12082,81 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 402, __pyx_L1_error) + __PYX_ERR(0, 442, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_var); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_var, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_4); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_var, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":403 + /* "constraint/constraints.py":443 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * domain = domains[var] # <<<<<<<<<<<<<< * for value in domain[:]: * if value * multiplier > max(domains[self.target_var]): */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":404 + /* "constraint/constraints.py":444 * for var, multiplier in zip(self.sum_vars, multipliers): * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< * if value * multiplier > max(domains[self.target_var]): * domain.remove(value) */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 444, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 404, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 444, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_11); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 404, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 444, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_12(__pyx_t_4); + __pyx_t_1 = __pyx_t_12(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 404, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 444, __pyx_L1_error) PyErr_Clear(); } break; @@ -11349,60 +12166,57 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":405 + /* "constraint/constraints.py":445 * domain = domains[var] * for value in domain[:]: * if value * multiplier > max(domains[self.target_var]): # <<<<<<<<<<<<<< * domain.remove(value) * else: */ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_13 = __pyx_builtin_max; - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_15}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_14}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_13 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 405, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 445, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":406 + /* "constraint/constraints.py":446 * for value in domain[:]: * if value * multiplier > max(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< * else: * for var in self.sum_vars: */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; - __pyx_t_13 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_value}; + __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 446, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); } - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "constraint/constraints.py":405 + /* "constraint/constraints.py":445 * domain = domains[var] * for value in domain[:]: * if value * multiplier > max(domains[self.target_var]): # <<<<<<<<<<<<<< @@ -11411,7 +12225,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":404 + /* "constraint/constraints.py":444 * for var, multiplier in zip(self.sum_vars, multipliers): * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -11419,9 +12233,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * domain.remove(value) */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":402 + /* "constraint/constraints.py":442 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -11431,7 +12245,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":401 + /* "constraint/constraints.py":441 * multipliers = self._multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -11441,7 +12255,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L3; } - /* "constraint/constraints.py":408 + /* "constraint/constraints.py":448 * domain.remove(value) * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -11449,52 +12263,52 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 448, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 408, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 448, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 408, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 448, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); + __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7)); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); #endif ++__pyx_t_7; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) } else { - __pyx_t_2 = __pyx_t_8(__pyx_t_4); + __pyx_t_2 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 408, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 448, __pyx_L1_error) PyErr_Clear(); } break; @@ -11506,127 +12320,121 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":409 + /* "constraint/constraints.py":449 * else: * for var in self.sum_vars: * domain = domains[var] # <<<<<<<<<<<<<< * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) */ - __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_var); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_var); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":410 + /* "constraint/constraints.py":450 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: */ - __pyx_t_13 = NULL; - __Pyx_INCREF(__pyx_builtin_sum); - __pyx_t_3 = __pyx_builtin_sum; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_14 = NULL; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = __pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 410, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_15}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_1}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_sum, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_others_min, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":411 + /* "constraint/constraints.py":451 * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): */ - __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_sum); - __pyx_t_15 = __pyx_builtin_sum; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_1 = __pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_3genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_1 = NULL; + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_4 = __pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_10preProcess_3genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_sum, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_others_max, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":412 + /* "constraint/constraints.py":452 * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: # <<<<<<<<<<<<<< * if value + others_min > max(domains[self.target_var]): * domain.remove(value) */ - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_15 = __pyx_t_2; __Pyx_INCREF(__pyx_t_15); + __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 412, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_15); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 452, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_15))) { + if (likely(PyList_CheckExact(__pyx_t_4))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_15); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 452, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_15, __pyx_t_11); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_15); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 452, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_11)); + __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11)); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_15, __pyx_t_11); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) } else { - __pyx_t_2 = __pyx_t_12(__pyx_t_15); + __pyx_t_2 = __pyx_t_12(__pyx_t_4); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 452, __pyx_L1_error) PyErr_Clear(); } break; @@ -11636,41 +12444,38 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":413 + /* "constraint/constraints.py":453 * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): # <<<<<<<<<<<<<< * domain.remove(value) * if value + others_max < min(domains[self.target_var]): */ - __pyx_t_2 = PyNumber_Add(__pyx_v_value, __pyx_v_others_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_value, __pyx_v_others_min); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_13 = __pyx_builtin_max; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_14 = NULL; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); + __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_14}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_13}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_13 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_13 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":414 + /* "constraint/constraints.py":454 * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -11682,14 +12487,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; - __pyx_t_13 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 414, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); } __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":413 + /* "constraint/constraints.py":453 * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): # <<<<<<<<<<<<<< @@ -11698,41 +12503,38 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":415 + /* "constraint/constraints.py":455 * if value + others_min > max(domains[self.target_var]): * domain.remove(value) * if value + others_max < min(domains[self.target_var]): # <<<<<<<<<<<<<< * domain.remove(value) * */ - __pyx_t_13 = PyNumber_Add(__pyx_v_value, __pyx_v_others_max); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_13 = PyNumber_Add(__pyx_v_value, __pyx_v_others_max); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_14 = __pyx_builtin_min; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_9}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_14 = PyObject_RichCompare(__pyx_t_13, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_13, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 415, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 455, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_6) { - /* "constraint/constraints.py":416 + /* "constraint/constraints.py":456 * domain.remove(value) * if value + others_max < min(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< @@ -11744,14 +12546,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; - __pyx_t_14 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); } - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":415 + /* "constraint/constraints.py":455 * if value + others_min > max(domains[self.target_var]): * domain.remove(value) * if value + others_max < min(domains[self.target_var]): # <<<<<<<<<<<<<< @@ -11760,7 +12562,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":412 + /* "constraint/constraints.py":452 * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: # <<<<<<<<<<<<<< @@ -11768,9 +12570,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * domain.remove(value) */ } - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":408 + /* "constraint/constraints.py":448 * domain.remove(value) * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -11778,11 +12580,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; - /* "constraint/constraints.py":396 + /* "constraint/constraints.py":436 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -11801,7 +12603,6 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); - __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -11819,7 +12620,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":418 +/* "constraint/constraints.py":458 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -11870,53 +12671,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 418, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 458, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 418, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 458, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 418, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 458, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 418, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 458, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 418, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 458, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 418, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 458, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 418, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 458, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 418, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 458, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 418, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 458, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 418, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 458, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 418, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 458, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 418, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 458, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 418, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 458, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -11930,7 +12731,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 418, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11941,8 +12742,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 418, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 418, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_26VariableExactSumConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -11978,10 +12779,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - size_t __pyx_t_6; - Py_ssize_t __pyx_t_7; - PyObject *(*__pyx_t_8)(PyObject *); + size_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); Py_ssize_t __pyx_t_11; @@ -11992,32 +12793,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":419 + /* "constraint/constraints.py":459 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers # <<<<<<<<<<<<<< * * if self.target_var not in assignments: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":421 + /* "constraint/constraints.py":461 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< * return True # can't evaluate without target, defer to later * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":422 + /* "constraint/constraints.py":462 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -12029,7 +12830,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":421 + /* "constraint/constraints.py":461 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -12038,22 +12839,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":424 + /* "constraint/constraints.py":464 * return True # can't evaluate without target, defer to later * * target_value = assignments[self.target_var] # <<<<<<<<<<<<<< * sum_value = 0 * missing = False */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_target_value = __pyx_t_3; __pyx_t_3 = 0; - /* "constraint/constraints.py":425 + /* "constraint/constraints.py":465 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -12063,7 +12864,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum_value = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":426 + /* "constraint/constraints.py":466 * target_value = assignments[self.target_var] * sum_value = 0 * missing = False # <<<<<<<<<<<<<< @@ -12072,17 +12873,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ __pyx_v_missing = 0; - /* "constraint/constraints.py":428 + /* "constraint/constraints.py":468 * missing = False * * if multipliers: # <<<<<<<<<<<<<< * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 468, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":429 + /* "constraint/constraints.py":469 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -12090,64 +12891,61 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * sum_value += assignments[var] * multiplier */ __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_4 = __pyx_builtin_zip; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = 1; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_v_multipliers}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_4, __pyx_v_multipliers}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); - __pyx_t_7 = 0; - __pyx_t_8 = NULL; + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 469, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_8)) { + if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 429, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 469, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); - ++__pyx_t_7; + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 429, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 469, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); #endif - ++__pyx_t_7; + ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_4); + __pyx_t_3 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 429, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 469, __pyx_L1_error) PyErr_Clear(); } break; @@ -12160,40 +12958,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 429, __pyx_L1_error) + __PYX_ERR(0, 469, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_5); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_1); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 469, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 469, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; + index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 429, __pyx_L1_error) + index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 469, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -12201,43 +12999,43 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 429, __pyx_L1_error) + __PYX_ERR(0, 469, __pyx_L1_error) __pyx_L8_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":430 + /* "constraint/constraints.py":470 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< * sum_value += assignments[var] * multiplier * else: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 470, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":431 + /* "constraint/constraints.py":471 * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: * sum_value += assignments[var] * multiplier # <<<<<<<<<<<<<< * else: * missing = True */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":430 + /* "constraint/constraints.py":470 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -12247,7 +13045,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L9; } - /* "constraint/constraints.py":433 + /* "constraint/constraints.py":473 * sum_value += assignments[var] * multiplier * else: * missing = True # <<<<<<<<<<<<<< @@ -12259,7 +13057,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L9:; - /* "constraint/constraints.py":429 + /* "constraint/constraints.py":469 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -12269,7 +13067,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":428 + /* "constraint/constraints.py":468 * missing = False * * if multipliers: # <<<<<<<<<<<<<< @@ -12279,7 +13077,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L4; } - /* "constraint/constraints.py":435 + /* "constraint/constraints.py":475 * missing = True * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -12287,52 +13085,52 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * sum_value += assignments[var] */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = 0; - __pyx_t_8 = NULL; + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { - if (likely(!__pyx_t_8)) { + if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 435, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 475, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_7); - ++__pyx_t_7; + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 435, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 475, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); #endif - ++__pyx_t_7; + ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_8(__pyx_t_3); + __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 435, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 475, __pyx_L1_error) PyErr_Clear(); } break; @@ -12342,32 +13140,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":436 + /* "constraint/constraints.py":476 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< * sum_value += assignments[var] * else: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 476, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":437 + /* "constraint/constraints.py":477 * for var in self.sum_vars: * if var in assignments: * sum_value += assignments[var] # <<<<<<<<<<<<<< * else: * sum_value += min(domains[var]) # use min value if not assigned */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 477, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":436 + /* "constraint/constraints.py":476 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -12377,7 +13175,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L13; } - /* "constraint/constraints.py":439 + /* "constraint/constraints.py":479 * sum_value += assignments[var] * else: * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< @@ -12386,27 +13184,24 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ /*else*/ { __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_5 = __pyx_builtin_min; - __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = 1; + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":440 + /* "constraint/constraints.py":480 * else: * sum_value += min(domains[var]) # use min value if not assigned * missing = True # <<<<<<<<<<<<<< @@ -12417,7 +13212,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L13:; - /* "constraint/constraints.py":435 + /* "constraint/constraints.py":475 * missing = True * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -12429,7 +13224,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __pyx_L4:; - /* "constraint/constraints.py":442 + /* "constraint/constraints.py":482 * missing = True * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -12439,29 +13234,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); if (__pyx_t_2) { - /* "constraint/constraints.py":443 + /* "constraint/constraints.py":483 * * if isinstance(sum_value, float): * sum_value = round(sum_value, 10) # <<<<<<<<<<<<<< * * if missing: */ - __pyx_t_5 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; - __pyx_t_6 = 1; + __pyx_t_1 = NULL; + __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_sum_value, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_sum_value, __pyx_mstate_global->__pyx_int_10}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":442 + /* "constraint/constraints.py":482 * missing = True * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -12470,7 +13262,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":445 + /* "constraint/constraints.py":485 * sum_value = round(sum_value, 10) * * if missing: # <<<<<<<<<<<<<< @@ -12479,19 +13271,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ if (__pyx_v_missing) { - /* "constraint/constraints.py":447 + /* "constraint/constraints.py":487 * if missing: * # Partial assignments: only check feasibility * if sum_value > target_value: # <<<<<<<<<<<<<< * return False * if forwardcheck: */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_sum_value, __pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_sum_value, __pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":448 + /* "constraint/constraints.py":488 * # Partial assignments: only check feasibility * if sum_value > target_value: * return False # <<<<<<<<<<<<<< @@ -12503,7 +13295,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":447 + /* "constraint/constraints.py":487 * if missing: * # Partial assignments: only check feasibility * if sum_value > target_value: # <<<<<<<<<<<<<< @@ -12512,69 +13304,69 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":449 + /* "constraint/constraints.py":489 * if sum_value > target_value: * return False * if forwardcheck: # <<<<<<<<<<<<<< * for var in self.sum_vars: * if var not in assignments: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 489, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":450 + /* "constraint/constraints.py":490 * return False * if forwardcheck: * for var in self.sum_vars: # <<<<<<<<<<<<<< * if var not in assignments: * domain = domains[var] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); - __pyx_t_7 = 0; - __pyx_t_8 = NULL; + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_8)) { + if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 450, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 490, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_7); - ++__pyx_t_7; + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 450, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 490, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif - ++__pyx_t_7; + ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_1); + __pyx_t_3 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 450, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 490, __pyx_L1_error) PyErr_Clear(); } break; @@ -12584,91 +13376,91 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":451 + /* "constraint/constraints.py":491 * if forwardcheck: * for var in self.sum_vars: * if var not in assignments: # <<<<<<<<<<<<<< * domain = domains[var] * if multipliers: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 491, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":452 + /* "constraint/constraints.py":492 * for var in self.sum_vars: * if var not in assignments: * domain = domains[var] # <<<<<<<<<<<<<< * if multipliers: * for value in domain[:]: */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":453 + /* "constraint/constraints.py":493 * if var not in assignments: * domain = domains[var] * if multipliers: # <<<<<<<<<<<<<< * for value in domain[:]: * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 493, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":454 + /* "constraint/constraints.py":494 * domain = domains[var] * if multipliers: * for value in domain[:]: # <<<<<<<<<<<<<< * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) * if temp_sum > target_value: */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); + __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 494, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { + if (likely(PyList_CheckExact(__pyx_t_8))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 454, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 494, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_11); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 454, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 494, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_11)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_11)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_11); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_11); #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_12(__pyx_t_5); + __pyx_t_3 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 454, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 494, __pyx_L1_error) PyErr_Clear(); } break; @@ -12678,70 +13470,70 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":455 + /* "constraint/constraints.py":495 * if multipliers: * for value in domain[:]: * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) # <<<<<<<<<<<<<< * if temp_sum > target_value: * domain.hideValue(value) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __pyx_t_4; - __Pyx_INCREF(__pyx_t_9); - __pyx_t_6 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __pyx_t_9; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_var}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_index, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_var}; + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_index, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_multipliers, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_multipliers, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_9); + __pyx_t_9 = 0; - /* "constraint/constraints.py":456 + /* "constraint/constraints.py":496 * for value in domain[:]: * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) * if temp_sum > target_value: # <<<<<<<<<<<<<< * domain.hideValue(value) * else: */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_temp_sum, __pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 456, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_v_temp_sum, __pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 496, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 496, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":457 + /* "constraint/constraints.py":497 * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) * if temp_sum > target_value: * domain.hideValue(value) # <<<<<<<<<<<<<< * else: - * for value in domain[:]: + * temp_sum = sum_value - min(domain) # sum_value already includes min for unassigned vars */ __pyx_t_3 = __pyx_v_domain; __Pyx_INCREF(__pyx_t_3); - __pyx_t_6 = 0; + __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":456 + /* "constraint/constraints.py":496 * for value in domain[:]: * temp_sum = sum_value + (value * multipliers[self.sum_vars.index(var)]) * if temp_sum > target_value: # <<<<<<<<<<<<<< @@ -12750,7 +13542,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":454 + /* "constraint/constraints.py":494 * domain = domains[var] * if multipliers: * for value in domain[:]: # <<<<<<<<<<<<<< @@ -12758,9 +13550,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain * if temp_sum > target_value: */ } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":453 + /* "constraint/constraints.py":493 * if var not in assignments: * domain = domains[var] * if multipliers: # <<<<<<<<<<<<<< @@ -12770,145 +13562,158 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain goto __pyx_L22; } - /* "constraint/constraints.py":459 + /* "constraint/constraints.py":499 * domain.hideValue(value) * else: - * for value in domain[:]: # <<<<<<<<<<<<<< - * temp_sum = sum_value + value - * if temp_sum > target_value: + * temp_sum = sum_value - min(domain) # sum_value already includes min for unassigned vars # <<<<<<<<<<<<<< + * for value in domain[:]: + * if temp_sum + value > target_value: */ /*else*/ { - __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { - __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); + __pyx_t_9 = NULL; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_domain}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + } + __pyx_t_9 = PyNumber_Subtract(__pyx_v_sum_value, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_9); + __pyx_t_9 = 0; + + /* "constraint/constraints.py":500 + * else: + * temp_sum = sum_value - min(domain) # sum_value already includes min for unassigned vars + * for value in domain[:]: # <<<<<<<<<<<<<< + * if temp_sum + value > target_value: + * domain.hideValue(value) +*/ + __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 459, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 500, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(PyList_CheckExact(__pyx_t_8))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 500, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_11); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 500, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11)); + __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_11)); #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_11); #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 500, __pyx_L1_error) } else { - __pyx_t_5 = __pyx_t_12(__pyx_t_4); - if (unlikely(!__pyx_t_5)) { + __pyx_t_9 = __pyx_t_12(__pyx_t_8); + if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 500, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_5); - __pyx_t_5 = 0; - - /* "constraint/constraints.py":460 - * else: - * for value in domain[:]: - * temp_sum = sum_value + value # <<<<<<<<<<<<<< - * if temp_sum > target_value: - * domain.hideValue(value) -*/ - __pyx_t_5 = PyNumber_Add(__pyx_v_sum_value, __pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_v_temp_sum, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_GOTREF(__pyx_t_9); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_9); + __pyx_t_9 = 0; - /* "constraint/constraints.py":461 + /* "constraint/constraints.py":501 + * temp_sum = sum_value - min(domain) # sum_value already includes min for unassigned vars * for value in domain[:]: - * temp_sum = sum_value + value - * if temp_sum > target_value: # <<<<<<<<<<<<<< + * if temp_sum + value > target_value: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_temp_sum, __pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 461, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 461, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_v_temp_sum, __pyx_v_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":462 - * temp_sum = sum_value + value - * if temp_sum > target_value: + /* "constraint/constraints.py":502 + * for value in domain[:]: + * if temp_sum + value > target_value: * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_6 = 0; + __pyx_t_9 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; - __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_value}; + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":461 + /* "constraint/constraints.py":501 + * temp_sum = sum_value - min(domain) # sum_value already includes min for unassigned vars * for value in domain[:]: - * temp_sum = sum_value + value - * if temp_sum > target_value: # <<<<<<<<<<<<<< + * if temp_sum + value > target_value: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ } - /* "constraint/constraints.py":459 - * domain.hideValue(value) + /* "constraint/constraints.py":500 * else: + * temp_sum = sum_value - min(domain) # sum_value already includes min for unassigned vars * for value in domain[:]: # <<<<<<<<<<<<<< - * temp_sum = sum_value + value - * if temp_sum > target_value: + * if temp_sum + value > target_value: + * domain.hideValue(value) */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_L22:; - /* "constraint/constraints.py":463 - * if temp_sum > target_value: + /* "constraint/constraints.py":503 + * if temp_sum + value > target_value: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 503, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_2); if (__pyx_t_13) { - /* "constraint/constraints.py":464 + /* "constraint/constraints.py":504 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -12921,8 +13726,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":463 - * if temp_sum > target_value: + /* "constraint/constraints.py":503 + * if temp_sum + value > target_value: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False @@ -12930,7 +13735,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":451 + /* "constraint/constraints.py":491 * if forwardcheck: * for var in self.sum_vars: * if var not in assignments: # <<<<<<<<<<<<<< @@ -12939,7 +13744,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":450 + /* "constraint/constraints.py":490 * return False * if forwardcheck: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -12949,7 +13754,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":449 + /* "constraint/constraints.py":489 * if sum_value > target_value: * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -12958,7 +13763,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":465 + /* "constraint/constraints.py":505 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -12970,7 +13775,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":445 + /* "constraint/constraints.py":485 * sum_value = round(sum_value, 10) * * if missing: # <<<<<<<<<<<<<< @@ -12979,7 +13784,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ } - /* "constraint/constraints.py":467 + /* "constraint/constraints.py":507 * return True * else: * return sum_value == target_value # <<<<<<<<<<<<<< @@ -12988,13 +13793,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_sum_value, __pyx_v_target_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_sum_value, __pyx_v_target_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } - /* "constraint/constraints.py":418 + /* "constraint/constraints.py":458 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -13007,7 +13812,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("constraint.constraints.VariableExactSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; @@ -13025,10 +13830,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_26VariableExactSumConstrain return __pyx_r; } -/* "constraint/constraints.py":481 +/* "constraint/constraints.py":526 * """ * - * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, minsum: int | float, multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -13075,41 +13880,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_minsum,&__pyx_mstate_global->__pyx_n_u_multipliers,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 481, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 526, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 481, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 526, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 481, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 526, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 481, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 526, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 481, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 526, __pyx_L3_error) if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 481, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 526, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 481, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 526, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 481, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 526, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 481, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 526, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -13121,7 +13926,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 481, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 526, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13145,33 +13950,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_minsum, PyObject *__pyx_v_multipliers) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":490 + /* "constraint/constraints.py":535 * summed to be checked * """ * self._minsum = minsum # <<<<<<<<<<<<<< * self._multipliers = multipliers - * + * self._var_max = {} */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minsum_2, __pyx_v_minsum) < 0) __PYX_ERR(0, 490, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minsum_2, __pyx_v_minsum) < (0)) __PYX_ERR(0, 535, __pyx_L1_error) - /* "constraint/constraints.py":491 + /* "constraint/constraints.py":536 * """ * self._minsum = minsum * self._multipliers = multipliers # <<<<<<<<<<<<<< + * self._var_max = {} * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 491, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < (0)) __PYX_ERR(0, 536, __pyx_L1_error) + + /* "constraint/constraints.py":537 + * self._minsum = minsum + * self._multipliers = multipliers + * self._var_max = {} # <<<<<<<<<<<<<< + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 +*/ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max, __pyx_t_1) < (0)) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":481 + /* "constraint/constraints.py":526 * """ * - * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, minsum: int | float, multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -13180,6 +13998,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("constraint.constraints.MinSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -13188,24 +14007,916 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ return __pyx_r; } -/* "constraint/constraints.py":493 - * self._multipliers = multipliers +/* "constraint/constraints.py":539 + * self._var_max = {} * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # check if each variable is in the assignments - * for variable in variables: + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_3preProcess(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10constraint_11constraints_16MinSumConstraint_3preProcess = {"preProcess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MinSumConstraint_3preProcess, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_3preProcess(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_domains = 0; + PyObject *__pyx_v_constraints = 0; + PyObject *__pyx_v_vconstraints = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[5] = {0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_SIZE + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 539, __pyx_L3_error) + if (__pyx_kwds_len > 0) { + switch (__pyx_nargs) { + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 539, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 539, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 539, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 539, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 539, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 539, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 539, __pyx_L3_error) } + } + } else if (unlikely(__pyx_nargs != 5)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 539, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 539, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 539, __pyx_L3_error) + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 539, __pyx_L3_error) + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 539, __pyx_L3_error) + } + __pyx_v_self = values[0]; + __pyx_v_variables = values[1]; + __pyx_v_domains = ((PyObject*)values[2]); + __pyx_v_constraints = ((PyObject*)values[3]); + __pyx_v_vconstraints = ((PyObject*)values[4]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 539, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __Pyx_AddTraceback("constraint.constraints.MinSumConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 539, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 539, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_r = __pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + goto __pyx_L7_cleaned_up; + __pyx_L0:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __pyx_L7_cleaned_up:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints) { + PyObject *__pyx_v_multipliers = NULL; + PyObject *__pyx_v_variable = NULL; + PyObject *__pyx_v_multiplier = NULL; + PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_others_max = NULL; + PyObject *__pyx_v_value = NULL; + PyObject *__pyx_8genexpr8__pyx_v_variable = NULL; + PyObject *__pyx_8genexpr8__pyx_v_multiplier = NULL; + PyObject *__pyx_8genexpr9__pyx_v_variable = NULL; + PyObject *__pyx_8genexpr9__pyx_v_multiplier = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + size_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *(*__pyx_t_11)(PyObject *); + Py_ssize_t __pyx_t_12; + PyObject *(*__pyx_t_13)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("preProcess", 0); + + /* "constraint/constraints.py":540 + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) + * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":541 + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) # <<<<<<<<<<<<<< + * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + * +*/ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_7 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_4 = PyList_New(1 * ((__pyx_t_7<0) ? 0:__pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_t_7; __pyx_temp++) { + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 541, __pyx_L1_error); + } + } + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":542 + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) + * self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< + * + * # preprocess the domains to remove values that cannot contribute to the minimum sum +*/ + { /* enter inner scope */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + } + if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { + __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 542, __pyx_L5_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 542, __pyx_L5_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_7; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 542, __pyx_L5_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L5_error) + } else { + __pyx_t_4 = __pyx_t_8(__pyx_t_2); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 542, __pyx_L5_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 542, __pyx_L5_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_9); + } else { + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L5_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 542, __pyx_L5_error) + __Pyx_XGOTREF(__pyx_t_9); + } + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 542, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 542, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 542, __pyx_L5_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_unpacking_failed:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 542, __pyx_L5_error) + __pyx_L9_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_variable, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_multiplier, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr8__pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_3}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_8genexpr8__pyx_v_multiplier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_8genexpr8__pyx_v_variable, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 542, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_multiplier); __pyx_8genexpr8__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_variable); __pyx_8genexpr8__pyx_v_variable = 0; + goto __pyx_L11_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_multiplier); __pyx_8genexpr8__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_variable); __pyx_8genexpr8__pyx_v_variable = 0; + goto __pyx_L1_error; + __pyx_L11_exit_scope:; + } /* exit inner scope */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max, __pyx_t_1) < (0)) __PYX_ERR(0, 542, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":545 + * + * # preprocess the domains to remove values that cannot contribute to the minimum sum + * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< + * domain = domains[variable] + * others_max = sum_other_vars(variables, variable, self._var_max) +*/ + __pyx_t_2 = NULL; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 545, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 545, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_7; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 545, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_8(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 545, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 545, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + } else { + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + } + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); + index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L15_unpacking_done; + __pyx_L14_unpacking_failed:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_L15_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_4); + __pyx_t_4 = 0; + + /* "constraint/constraints.py":546 + * # preprocess the domains to remove values that cannot contribute to the minimum sum + * for variable, multiplier in zip(variables, multipliers): + * domain = domains[variable] # <<<<<<<<<<<<<< + * others_max = sum_other_vars(variables, variable, self._var_max) + * for value in domain[:]: +*/ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":547 + * for variable, multiplier in zip(variables, multipliers): + * domain = domains[variable] + * others_max = sum_other_vars(variables, variable, self._var_max) # <<<<<<<<<<<<<< + * for value in domain[:]: + * if value * multiplier + others_max < self._minsum: +*/ + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sum_other_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_variables, __pyx_v_variable, __pyx_t_9}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_others_max, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":548 + * domain = domains[variable] + * others_max = sum_other_vars(variables, variable, self._var_max) + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value * multiplier + others_max < self._minsum: + * domain.remove(value) +*/ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); + __pyx_t_12 = 0; + __pyx_t_13 = NULL; + } else { + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 548, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_13)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 548, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_12; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 548, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); + #endif + ++__pyx_t_12; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_13(__pyx_t_3); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 548, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":549 + * others_max = sum_other_vars(variables, variable, self._var_max) + * for value in domain[:]: + * if value * multiplier + others_max < self._minsum: # <<<<<<<<<<<<<< + * domain.remove(value) + * +*/ + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyNumber_Add(__pyx_t_1, __pyx_v_others_max); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_9, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "constraint/constraints.py":550 + * for value in domain[:]: + * if value * multiplier + others_max < self._minsum: + * domain.remove(value) # <<<<<<<<<<<<<< + * + * # recalculate the max after pruning +*/ + __pyx_t_1 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; + __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":549 + * others_max = sum_other_vars(variables, variable, self._var_max) + * for value in domain[:]: + * if value * multiplier + others_max < self._minsum: # <<<<<<<<<<<<<< + * domain.remove(value) + * +*/ + } + + /* "constraint/constraints.py":548 + * domain = domains[variable] + * others_max = sum_other_vars(variables, variable, self._var_max) + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value * multiplier + others_max < self._minsum: + * domain.remove(value) +*/ + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/constraints.py":545 + * + * # preprocess the domains to remove values that cannot contribute to the minimum sum + * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< + * domain = domains[variable] + * others_max = sum_other_vars(variables, variable, self._var_max) +*/ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":553 + * + * # recalculate the max after pruning + * self._var_max = { variable: max(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 +*/ + { /* enter inner scope */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); + } + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L23_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 553, __pyx_L23_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_7; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 553, __pyx_L23_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L23_error) + } else { + __pyx_t_3 = __pyx_t_8(__pyx_t_4); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 553, __pyx_L23_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_3); + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 553, __pyx_L23_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_9); + } else { + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_9); + } + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 553, __pyx_L23_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L27_unpacking_done; + __pyx_L26_unpacking_failed:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 553, __pyx_L23_error) + __pyx_L27_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_multiplier, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr9__pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = (__pyx_t_12 > 0); + if (__pyx_t_6) { + __pyx_t_1 = NULL; + __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr9__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_10}; + __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + } + __pyx_t_10 = PyNumber_Multiply(__pyx_t_9, __pyx_8genexpr9__pyx_v_multiplier); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_3 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_t_3 = __pyx_mstate_global->__pyx_int_0; + } + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_8genexpr9__pyx_v_variable, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 553, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_multiplier); __pyx_8genexpr9__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_variable); __pyx_8genexpr9__pyx_v_variable = 0; + goto __pyx_L29_exit_scope; + __pyx_L23_error:; + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_multiplier); __pyx_8genexpr9__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_variable); __pyx_8genexpr9__pyx_v_variable = 0; + goto __pyx_L1_error; + __pyx_L29_exit_scope:; + } /* exit inner scope */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max, __pyx_t_2) < (0)) __PYX_ERR(0, 553, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":539 + * self._var_max = {} + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) +*/ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_AddTraceback("constraint.constraints.MinSumConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_multipliers); + __Pyx_XDECREF(__pyx_v_variable); + __Pyx_XDECREF(__pyx_v_multiplier); + __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_others_max); + __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_variable); + __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_multiplier); + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_variable); + __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_multiplier); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":555 + * self._var_max = { variable: max(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers + * minsum = self._minsum */ /* Python wrapper */ -static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_3__call__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_5__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_11constraints_16MinSumConstraint_3__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MinSumConstraint_3__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_3__call__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10constraint_11constraints_16MinSumConstraint_5__call__ = {"__call__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_16MinSumConstraint_5__call__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_5__call__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -13239,53 +14950,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 493, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 555, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 493, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 555, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 493, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 555, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 493, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 555, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 493, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 555, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 493, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 555, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 493, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 555, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 493, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 555, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 493, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 555, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 493, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 555, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 493, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 555, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 493, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 555, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 493, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 555, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -13299,7 +15010,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 493, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 555, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13310,9 +15021,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 493, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 493, __pyx_L1_error) - __pyx_r = __pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 555, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_r = __pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ goto __pyx_L0; @@ -13331,21 +15042,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, CYTHON_UNUSED PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck) { - PyObject *__pyx_v_variable = NULL; +static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, CYTHON_UNUSED PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck) { PyObject *__pyx_v_multipliers = NULL; PyObject *__pyx_v_minsum = NULL; PyObject *__pyx_v_sum = NULL; + int __pyx_v_missing; + PyObject *__pyx_v_max_sum_missing = NULL; + PyObject *__pyx_v_variable = NULL; PyObject *__pyx_v_multiplier = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - size_t __pyx_t_7; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + size_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); @@ -13354,214 +15067,129 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":495 - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * # check if each variable is in the assignments - * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: - * return True -*/ - if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 495, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); - ++__pyx_t_2; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 495, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); - #endif - ++__pyx_t_2; - } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error) - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 495, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; - - /* "constraint/constraints.py":496 - * # check if each variable is in the assignments - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * return True - * -*/ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 496, __pyx_L1_error) - if (__pyx_t_5) { - - /* "constraint/constraints.py":497 - * for variable in variables: - * if variable not in assignments: - * return True # <<<<<<<<<<<<<< - * - * # with each variable assigned, sum the values -*/ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - - /* "constraint/constraints.py":496 - * # check if each variable is in the assignments - * for variable in variables: - * if variable not in assignments: # <<<<<<<<<<<<<< - * return True - * -*/ - } - - /* "constraint/constraints.py":495 - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - * # check if each variable is in the assignments - * for variable in variables: # <<<<<<<<<<<<<< - * if variable not in assignments: - * return True -*/ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "constraint/constraints.py":500 + /* "constraint/constraints.py":556 * - * # with each variable assigned, sum the values + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers # <<<<<<<<<<<<<< * minsum = self._minsum * sum = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":501 - * # with each variable assigned, sum the values + /* "constraint/constraints.py":557 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers * minsum = self._minsum # <<<<<<<<<<<<<< * sum = 0 - * if multipliers: + * missing = False */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":502 + /* "constraint/constraints.py":558 * multipliers = self._multipliers * minsum = self._minsum * sum = 0 # <<<<<<<<<<<<<< - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): + * missing = False + * max_sum_missing = 0 */ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":503 + /* "constraint/constraints.py":559 * minsum = self._minsum * sum = 0 + * missing = False # <<<<<<<<<<<<<< + * max_sum_missing = 0 + * if multipliers: +*/ + __pyx_v_missing = 0; + + /* "constraint/constraints.py":560 + * sum = 0 + * missing = False + * max_sum_missing = 0 # <<<<<<<<<<<<<< + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_max_sum_missing = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":561 + * missing = False + * max_sum_missing = 0 * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): - * sum += assignments[variable] * multiplier + * if variable in assignments: */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 503, __pyx_L1_error) - if (__pyx_t_5) { + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 561, __pyx_L1_error) + if (__pyx_t_2) { - /* "constraint/constraints.py":504 - * sum = 0 + /* "constraint/constraints.py":562 + * max_sum_missing = 0 * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * sum += assignments[variable] * multiplier - * else: + * if variable in assignments: + * sum += assignments[variable] * multiplier */ - __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_6 = __pyx_builtin_zip; - __pyx_t_7 = 1; + __pyx_t_3 = NULL; + __pyx_t_4 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); - __pyx_t_2 = 0; - __pyx_t_3 = NULL; + __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 562, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 504, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 562, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_2); - ++__pyx_t_2; + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 504, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 562, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); #endif - ++__pyx_t_2; + ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_3(__pyx_t_6); + __pyx_t_1 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 504, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 562, __pyx_L1_error) PyErr_Clear(); } break; @@ -13574,144 +15202,194 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 504, __pyx_L1_error) + __PYX_ERR(0, 562, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_4); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L10_unpacking_failed; + index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 504, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 562, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L11_unpacking_done; - __pyx_L10_unpacking_failed:; + goto __pyx_L7_unpacking_done; + __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 504, __pyx_L1_error) - __pyx_L11_unpacking_done:; + __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_L7_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); + __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":505 + /* "constraint/constraints.py":563 * if multipliers: * for variable, multiplier in zip(variables, multipliers): - * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< + * if variable in assignments: # <<<<<<<<<<<<<< + * sum += assignments[variable] * multiplier + * else: +*/ + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 563, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":564 + * for variable, multiplier in zip(variables, multipliers): + * if variable in assignments: + * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< + * else: + * max_sum_missing += self._var_max[variable] +*/ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":563 + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): + * if variable in assignments: # <<<<<<<<<<<<<< + * sum += assignments[variable] * multiplier + * else: +*/ + goto __pyx_L8; + } + + /* "constraint/constraints.py":566 + * sum += assignments[variable] * multiplier + * else: + * max_sum_missing += self._var_max[variable] # <<<<<<<<<<<<<< + * missing = True + * else: +*/ + /*else*/ { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_max_sum_missing, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_max_sum_missing, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":567 + * else: + * max_sum_missing += self._var_max[variable] + * missing = True # <<<<<<<<<<<<<< * else: * for variable in variables: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_missing = 1; + } + __pyx_L8:; - /* "constraint/constraints.py":504 - * sum = 0 + /* "constraint/constraints.py":562 + * max_sum_missing = 0 * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * sum += assignments[variable] * multiplier - * else: + * if variable in assignments: + * sum += assignments[variable] * multiplier */ } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":503 - * minsum = self._minsum - * sum = 0 + /* "constraint/constraints.py":561 + * missing = False + * max_sum_missing = 0 * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): - * sum += assignments[variable] * multiplier + * if variable in assignments: */ - goto __pyx_L7; + goto __pyx_L3; } - /* "constraint/constraints.py":507 - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":569 + * missing = True * else: * for variable in variables: # <<<<<<<<<<<<<< - * sum += assignments[variable] - * if isinstance(sum, float): + * if variable in assignments: + * sum += assignments[variable] */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_6 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_6); - __pyx_t_2 = 0; - __pyx_t_3 = NULL; + __pyx_t_3 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 569, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 507, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 569, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_2); - ++__pyx_t_2; + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 507, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 569, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); #endif - ++__pyx_t_2; + ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_3(__pyx_t_6); + __pyx_t_1 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 507, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 569, __pyx_L1_error) PyErr_Clear(); } break; @@ -13721,119 +15399,217 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":508 + /* "constraint/constraints.py":570 * else: * for variable in variables: - * sum += assignments[variable] # <<<<<<<<<<<<<< + * if variable in assignments: # <<<<<<<<<<<<<< + * sum += assignments[variable] + * else: +*/ + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 570, __pyx_L1_error) + if (__pyx_t_2) { + + /* "constraint/constraints.py":571 + * for variable in variables: + * if variable in assignments: + * sum += assignments[variable] # <<<<<<<<<<<<<< + * else: + * max_sum_missing += self._var_max[variable] +*/ + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_8); + __pyx_t_8 = 0; + + /* "constraint/constraints.py":570 + * else: + * for variable in variables: + * if variable in assignments: # <<<<<<<<<<<<<< + * sum += assignments[variable] + * else: +*/ + goto __pyx_L12; + } + + /* "constraint/constraints.py":573 + * sum += assignments[variable] + * else: + * max_sum_missing += self._var_max[variable] # <<<<<<<<<<<<<< + * missing = True + * +*/ + /*else*/ { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_max); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_max_sum_missing, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_max_sum_missing, __pyx_t_8); + __pyx_t_8 = 0; + + /* "constraint/constraints.py":574 + * else: + * max_sum_missing += self._var_max[variable] + * missing = True # <<<<<<<<<<<<<< + * * if isinstance(sum, float): - * sum = round(sum, 10) */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 508, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_8); - __pyx_t_8 = 0; + __pyx_v_missing = 1; + } + __pyx_L12:; - /* "constraint/constraints.py":507 - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":569 + * missing = True * else: * for variable in variables: # <<<<<<<<<<<<<< - * sum += assignments[variable] - * if isinstance(sum, float): + * if variable in assignments: + * sum += assignments[variable] */ } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_L7:; + __pyx_L3:; - /* "constraint/constraints.py":509 - * for variable in variables: - * sum += assignments[variable] + /* "constraint/constraints.py":576 + * missing = True + * * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * return sum >= minsum + * if sum + max_sum_missing < minsum: */ - __pyx_t_5 = PyFloat_Check(__pyx_v_sum); - if (__pyx_t_5) { + __pyx_t_2 = PyFloat_Check(__pyx_v_sum); + if (__pyx_t_2) { - /* "constraint/constraints.py":510 - * sum += assignments[variable] + /* "constraint/constraints.py":577 + * * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< - * return sum >= minsum - * + * if sum + max_sum_missing < minsum: + * return False */ __pyx_t_8 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; - __pyx_t_7 = 1; + __pyx_t_4 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_6); - __pyx_t_6 = 0; + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":509 - * for variable in variables: - * sum += assignments[variable] + /* "constraint/constraints.py":576 + * missing = True + * * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * return sum >= minsum + * if sum + max_sum_missing < minsum: */ } - /* "constraint/constraints.py":511 + /* "constraint/constraints.py":578 + * if isinstance(sum, float): + * sum = round(sum, 10) + * if sum + max_sum_missing < minsum: # <<<<<<<<<<<<<< + * return False + * return sum >= minsum or missing +*/ + __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_max_sum_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_v_minsum, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 578, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 578, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":579 + * sum = round(sum, 10) + * if sum + max_sum_missing < minsum: + * return False # <<<<<<<<<<<<<< + * return sum >= minsum or missing + * +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "constraint/constraints.py":578 * if isinstance(sum, float): * sum = round(sum, 10) - * return sum >= minsum # <<<<<<<<<<<<<< + * if sum + max_sum_missing < minsum: # <<<<<<<<<<<<<< + * return False + * return sum >= minsum or missing +*/ + } + + /* "constraint/constraints.py":580 + * if sum + max_sum_missing < minsum: + * return False + * return sum >= minsum or missing # <<<<<<<<<<<<<< * * class VariableMinSumConstraint(Constraint): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_minsum, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 511, __pyx_L1_error) - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_minsum, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 580, __pyx_L1_error) + if (!__pyx_t_2) { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_INCREF(__pyx_t_3); + __pyx_t_8 = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L16_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_L16_bool_binop_done:; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; goto __pyx_L0; - /* "constraint/constraints.py":493 - * self._multipliers = multipliers + /* "constraint/constraints.py":555 + * self._var_max = { variable: max(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # check if each variable is in the assignments - * for variable in variables: + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers + * minsum = self._minsum */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("constraint.constraints.MinSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_variable); __Pyx_XDECREF(__pyx_v_multipliers); __Pyx_XDECREF(__pyx_v_minsum); __Pyx_XDECREF(__pyx_v_sum); + __Pyx_XDECREF(__pyx_v_max_sum_missing); + __Pyx_XDECREF(__pyx_v_variable); __Pyx_XDECREF(__pyx_v_multiplier); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":524 +/* "constraint/constraints.py":599 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -13881,47 +15657,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_target_var,&__pyx_mstate_global->__pyx_n_u_sum_vars,&__pyx_mstate_global->__pyx_n_u_multipliers,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 524, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 599, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 599, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 599, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 599, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 599, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 524, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 599, __pyx_L3_error) if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 524, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 599, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 599, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 599, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 599, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 524, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 599, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -13934,7 +15710,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 524, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 599, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -13945,7 +15721,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 524, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 599, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_24VariableMinSumConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_target_var, __pyx_v_sum_vars, __pyx_v_multipliers); /* function exit code */ @@ -13966,7 +15742,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_8__init___2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":540 +/* "constraint/constraints.py":615 * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." # <<<<<<<<<<<<<< @@ -13986,7 +15762,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 540, __pyx_L1_error) + __PYX_ERR(0, 615, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -13994,7 +15770,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_8__init___2generator3, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint___init, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_8__init___2generator3, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint___init, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -14032,16 +15808,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 540, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 540, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 615, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 615, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -14049,17 +15825,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 540, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 615, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 540, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 615, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -14070,13 +15846,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 540, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 615, __pyx_L1_error) PyErr_Clear(); } break; @@ -14134,10 +15910,10 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":524 +/* "constraint/constraints.py":599 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -14156,44 +15932,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":534 + /* "constraint/constraints.py":609 * summed to match the last variable. * """ * self.target_var = target_var # <<<<<<<<<<<<<< * self.sum_vars = sum_vars * self._multipliers = multipliers */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < 0) __PYX_ERR(0, 534, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < (0)) __PYX_ERR(0, 609, __pyx_L1_error) - /* "constraint/constraints.py":535 + /* "constraint/constraints.py":610 * """ * self.target_var = target_var * self.sum_vars = sum_vars # <<<<<<<<<<<<<< * self._multipliers = multipliers * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_v_sum_vars) < 0) __PYX_ERR(0, 535, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_v_sum_vars) < (0)) __PYX_ERR(0, 610, __pyx_L1_error) - /* "constraint/constraints.py":536 + /* "constraint/constraints.py":611 * self.target_var = target_var * self.sum_vars = sum_vars * self._multipliers = multipliers # <<<<<<<<<<<<<< * * if multipliers: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 536, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < (0)) __PYX_ERR(0, 611, __pyx_L1_error) - /* "constraint/constraints.py":538 + /* "constraint/constraints.py":613 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 613, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/constraints.py":539 + /* "constraint/constraints.py":614 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -14202,19 +15978,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_2 = PyObject_Length(__pyx_v_multipliers); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 539, __pyx_L1_error) - __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_v_multipliers); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 614, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 == (__pyx_t_3 + 1)); if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_Multipliers_must_match_sum_varia, 0, 0); - __PYX_ERR(0, 539, __pyx_L1_error) + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_match_sum_varia, 0, 0); + __PYX_ERR(0, 614, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 539, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 614, __pyx_L1_error) #endif - /* "constraint/constraints.py":540 + /* "constraint/constraints.py":615 * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." # <<<<<<<<<<<<<< @@ -14223,23 +15999,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_4 = __pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_8__init___genexpr(NULL, __pyx_v_multipliers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_8__init___genexpr(NULL, __pyx_v_multipliers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_Multipliers_must_be_numbers, 0, 0); - __PYX_ERR(0, 540, __pyx_L1_error) + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_be_numbers, 0, 0); + __PYX_ERR(0, 615, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 540, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 615, __pyx_L1_error) #endif - /* "constraint/constraints.py":541 + /* "constraint/constraints.py":616 * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." # <<<<<<<<<<<<<< @@ -14248,20 +16024,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_multipliers, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_multipliers, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_Last_multiplier_must_be_1_as_it, 0, 0); - __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Last_multiplier_must_be_1_as_it, 0, 0); + __PYX_ERR(0, 616, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 541, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 616, __pyx_L1_error) #endif - /* "constraint/constraints.py":538 + /* "constraint/constraints.py":613 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -14270,10 +16046,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":524 + /* "constraint/constraints.py":599 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -14293,7 +16069,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":543 +/* "constraint/constraints.py":618 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -14344,50 +16120,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 543, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 618, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 543, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 618, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 543, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 618, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 543, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 618, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 543, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 618, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 543, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 618, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 543, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 618, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 543, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 618, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 543, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 618, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 543, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 618, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 543, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 618, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 543, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 618, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 543, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 618, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -14397,7 +16173,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 543, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 618, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14408,9 +16184,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 543, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 543, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 543, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 618, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 618, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 618, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -14431,7 +16207,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_10preProcess_2generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":551 +/* "constraint/constraints.py":626 * for var in self.sum_vars: * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -14451,7 +16227,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 551, __pyx_L1_error) + __PYX_ERR(0, 626, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -14462,7 +16238,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_10preProcess_2generator4, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint_preProc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_10preProcess_2generator4, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint_preProc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -14489,8 +16265,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - size_t __pyx_t_9; + size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -14506,17 +16281,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ __pyx_L3_first_run:; if (unlikely(__pyx_sent_value != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); - __PYX_ERR(0, 551, __pyx_L1_error) + __PYX_ERR(0, 626, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 551, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 626, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -14524,17 +16299,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 551, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 551, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -14545,13 +16320,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 551, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 626, __pyx_L1_error) PyErr_Clear(); } break; @@ -14562,29 +16337,26 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 551, __pyx_L1_error) } - __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_v, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 551, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 626, __pyx_L1_error) } + __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_v, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __pyx_t_6 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_7 = __pyx_builtin_max; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 551, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 626, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 551, __pyx_L1_error) + __PYX_ERR(0, 626, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_v); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = 1; + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -14605,7 +16377,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 551, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 626, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -14619,7 +16391,6 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -14635,7 +16406,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":543 +/* "constraint/constraints.py":618 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -14662,11 +16433,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - Py_ssize_t __pyx_t_12; - PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); + PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -14675,7 +16445,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 543, __pyx_L1_error) + __PYX_ERR(0, 618, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -14683,7 +16453,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_domains); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_domains); - /* "constraint/constraints.py":544 + /* "constraint/constraints.py":619 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -14691,9 +16461,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ * multipliers = self._multipliers */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -14710,54 +16480,54 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_self, __pyx_v_variables, __pyx_cur_scope->__pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":546 + /* "constraint/constraints.py":621 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * * multipliers = self._multipliers # <<<<<<<<<<<<<< * * if not multipliers: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":548 + /* "constraint/constraints.py":623 * multipliers = self._multipliers * * if not multipliers: # <<<<<<<<<<<<<< * for var in self.sum_vars: * domain = domains[var] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 623, __pyx_L1_error) __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "constraint/constraints.py":549 + /* "constraint/constraints.py":624 * * if not multipliers: * for var in self.sum_vars: # <<<<<<<<<<<<<< * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 624, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -14766,17 +16536,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 549, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 624, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_8); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 549, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 624, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -14787,13 +16557,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 549, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 624, __pyx_L1_error) PyErr_Clear(); } break; @@ -14805,19 +16575,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":550 + /* "constraint/constraints.py":625 * if not multipliers: * for var in self.sum_vars: * domain = domains[var] # <<<<<<<<<<<<<< * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":551 + /* "constraint/constraints.py":626 * for var in self.sum_vars: * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -14825,79 +16595,76 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ * if value + others_max < min(domains[self.target_var]): */ __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_sum); - __pyx_t_3 = __pyx_builtin_sum; - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_10preProcess_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_10preProcess_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_11}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_10}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_sum, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_others_max, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":552 + /* "constraint/constraints.py":627 * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: # <<<<<<<<<<<<<< * if value + others_max < min(domains[self.target_var]): * domain.remove(value) */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); - __pyx_t_12 = 0; - __pyx_t_13 = NULL; + __pyx_t_10 = __pyx_t_1; __Pyx_INCREF(__pyx_t_10); + __pyx_t_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 552, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 627, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 627, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_10))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 552, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 627, __pyx_L1_error) #endif - if (__pyx_t_12 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); - ++__pyx_t_12; + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_11; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 552, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 627, __pyx_L1_error) #endif - if (__pyx_t_12 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_11)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_11); #endif - ++__pyx_t_12; + ++__pyx_t_11; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_13(__pyx_t_3); + __pyx_t_1 = __pyx_t_12(__pyx_t_10); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 552, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 627, __pyx_L1_error) PyErr_Clear(); } break; @@ -14907,60 +16674,57 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":553 + /* "constraint/constraints.py":628 * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: * if value + others_max < min(domains[self.target_var]): # <<<<<<<<<<<<<< * domain.remove(value) * */ - __pyx_t_1 = PyNumber_Add(__pyx_v_value, __pyx_v_others_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_value, __pyx_v_others_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_10 = __pyx_builtin_min; - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_3 = NULL; + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_15}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_14}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_11, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 553, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":554 + /* "constraint/constraints.py":629 * for value in domain[:]: * if value + others_max < min(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 */ - __pyx_t_11 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_11); + __pyx_t_2 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_value}; - __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value}; + __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 629, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "constraint/constraints.py":553 + /* "constraint/constraints.py":628 * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: * if value + others_max < min(domains[self.target_var]): # <<<<<<<<<<<<<< @@ -14969,7 +16733,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":552 + /* "constraint/constraints.py":627 * domain = domains[var] * others_max = sum(max(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: # <<<<<<<<<<<<<< @@ -14977,9 +16741,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ * domain.remove(value) */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":549 + /* "constraint/constraints.py":624 * * if not multipliers: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -14989,7 +16753,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":548 + /* "constraint/constraints.py":623 * multipliers = self._multipliers * * if not multipliers: # <<<<<<<<<<<<<< @@ -14998,7 +16762,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":543 + /* "constraint/constraints.py":618 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -15015,9 +16779,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); - __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("constraint.constraints.VariableMinSumConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -15032,7 +16795,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":556 +/* "constraint/constraints.py":631 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -15083,53 +16846,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 556, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 631, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 556, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 631, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 556, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 631, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 556, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 631, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 556, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 631, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 556, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 631, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 556, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 631, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 556, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 631, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 556, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 631, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 556, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 631, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 556, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 631, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 556, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 631, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 556, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 631, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -15143,7 +16906,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 556, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 631, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15154,8 +16917,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 556, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 556, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 631, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 631, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -15187,44 +16950,43 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - size_t __pyx_t_6; - Py_ssize_t __pyx_t_7; - PyObject *(*__pyx_t_8)(PyObject *); + size_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); - PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":557 + /* "constraint/constraints.py":632 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers # <<<<<<<<<<<<<< * * if self.target_var not in assignments: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":559 + /* "constraint/constraints.py":634 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< * return True # can't evaluate without target, defer to later * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":560 + /* "constraint/constraints.py":635 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -15236,7 +16998,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":559 + /* "constraint/constraints.py":634 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -15245,22 +17007,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":562 + /* "constraint/constraints.py":637 * return True # can't evaluate without target, defer to later * * target_value = assignments[self.target_var] # <<<<<<<<<<<<<< * sum_value = 0 * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_target_value = __pyx_t_3; __pyx_t_3 = 0; - /* "constraint/constraints.py":563 + /* "constraint/constraints.py":638 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -15270,17 +17032,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum_value = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":565 + /* "constraint/constraints.py":640 * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 640, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":566 + /* "constraint/constraints.py":641 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -15288,64 +17050,61 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ * sum_value += assignments[var] * multiplier */ __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_4 = __pyx_builtin_zip; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = 1; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_v_multipliers}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_4, __pyx_v_multipliers}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); - __pyx_t_7 = 0; - __pyx_t_8 = NULL; + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 641, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_8)) { + if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 641, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); - ++__pyx_t_7; + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 641, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); #endif - ++__pyx_t_7; + ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_4); + __pyx_t_3 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 641, __pyx_L1_error) PyErr_Clear(); } break; @@ -15358,40 +17117,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 566, __pyx_L1_error) + __PYX_ERR(0, 641, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_5); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_1); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; + index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 641, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -15399,43 +17158,43 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 566, __pyx_L1_error) + __PYX_ERR(0, 641, __pyx_L1_error) __pyx_L8_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":567 + /* "constraint/constraints.py":642 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< * sum_value += assignments[var] * multiplier * else: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 642, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":568 + /* "constraint/constraints.py":643 * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: * sum_value += assignments[var] * multiplier # <<<<<<<<<<<<<< * else: * sum_value += max(domains[var] * multiplier) # use max value if not assigned */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 643, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":567 + /* "constraint/constraints.py":642 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -15445,7 +17204,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L9; } - /* "constraint/constraints.py":570 + /* "constraint/constraints.py":645 * sum_value += assignments[var] * multiplier * else: * sum_value += max(domains[var] * multiplier) # use max value if not assigned # <<<<<<<<<<<<<< @@ -15453,33 +17212,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ * for var in self.sum_vars: */ /*else*/ { - __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_5 = __pyx_builtin_max; - __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_8 = NULL; + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = PyNumber_Multiply(__pyx_t_9, __pyx_v_multiplier); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_6 = 1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_11}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_9); + __pyx_t_9 = 0; } __pyx_L9:; - /* "constraint/constraints.py":566 + /* "constraint/constraints.py":641 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -15489,7 +17245,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":565 + /* "constraint/constraints.py":640 * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< @@ -15499,7 +17255,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L4; } - /* "constraint/constraints.py":572 + /* "constraint/constraints.py":647 * sum_value += max(domains[var] * multiplier) # use max value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -15507,52 +17263,52 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ * sum_value += assignments[var] */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); - __pyx_t_7 = 0; - __pyx_t_8 = NULL; + __pyx_t_9 = __pyx_t_4; __Pyx_INCREF(__pyx_t_9); + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 647, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { - if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_9))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 572, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 647, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_7); - ++__pyx_t_7; + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_6; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 572, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 647, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_6); #endif - ++__pyx_t_7; + ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_8(__pyx_t_5); + __pyx_t_4 = __pyx_t_7(__pyx_t_9); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 572, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 647, __pyx_L1_error) PyErr_Clear(); } break; @@ -15562,32 +17318,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":573 + /* "constraint/constraints.py":648 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< * sum_value += assignments[var] * else: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 648, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":574 + /* "constraint/constraints.py":649 * for var in self.sum_vars: * if var in assignments: * sum_value += assignments[var] # <<<<<<<<<<<<<< * else: * sum_value += max(domains[var]) # use max value if not assigned */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":573 + /* "constraint/constraints.py":648 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -15597,7 +17353,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ goto __pyx_L13; } - /* "constraint/constraints.py":576 + /* "constraint/constraints.py":651 * sum_value += assignments[var] * else: * sum_value += max(domains[var]) # use max value if not assigned # <<<<<<<<<<<<<< @@ -15606,29 +17362,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ /*else*/ { __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_11 = __pyx_builtin_max; - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = 1; + __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 576, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_11); - __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_8); + __pyx_t_8 = 0; } __pyx_L13:; - /* "constraint/constraints.py":572 + /* "constraint/constraints.py":647 * sum_value += max(domains[var] * multiplier) # use max value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -15636,11 +17389,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ * sum_value += assignments[var] */ } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_L4:; - /* "constraint/constraints.py":578 + /* "constraint/constraints.py":653 * sum_value += max(domains[var]) # use max value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -15650,29 +17403,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); if (__pyx_t_2) { - /* "constraint/constraints.py":579 + /* "constraint/constraints.py":654 * * if isinstance(sum_value, float): * sum_value = round(sum_value, 10) # <<<<<<<<<<<<<< * * return sum_value >= target_value */ - __pyx_t_11 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_3 = __pyx_builtin_round; - __pyx_t_6 = 1; + __pyx_t_8 = NULL; + __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_v_sum_value, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_sum_value, __pyx_mstate_global->__pyx_int_10}; + __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 654, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); } - __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_9); + __pyx_t_9 = 0; - /* "constraint/constraints.py":578 + /* "constraint/constraints.py":653 * sum_value += max(domains[var]) # use max value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -15681,7 +17431,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ */ } - /* "constraint/constraints.py":581 + /* "constraint/constraints.py":656 * sum_value = round(sum_value, 10) * * return sum_value >= target_value # <<<<<<<<<<<<<< @@ -15689,12 +17439,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_sum_value, __pyx_v_target_value, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 581, __pyx_L1_error) - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_v_sum_value, __pyx_v_target_value, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; goto __pyx_L0; - /* "constraint/constraints.py":556 + /* "constraint/constraints.py":631 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -15707,9 +17457,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("constraint.constraints.VariableMinSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -15723,10 +17472,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMinSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":595 +/* "constraint/constraints.py":675 * """ * - * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, maxsum: int | float, multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -15773,41 +17522,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_maxsum,&__pyx_mstate_global->__pyx_n_u_multipliers,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 595, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 675, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 595, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 675, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 595, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 675, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 595, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 675, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 595, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 675, __pyx_L3_error) if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 595, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, i); __PYX_ERR(0, 675, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 595, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 675, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 595, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 675, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 595, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 675, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -15819,7 +17568,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 595, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 675, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15843,33 +17592,58 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_maxsum, PyObject *__pyx_v_multipliers) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":604 + /* "constraint/constraints.py":684 * summed to be checked * """ * self._maxsum = maxsum # <<<<<<<<<<<<<< * self._multipliers = multipliers - * + * self._var_min = {} */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2, __pyx_v_maxsum) < 0) __PYX_ERR(0, 604, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2, __pyx_v_maxsum) < (0)) __PYX_ERR(0, 684, __pyx_L1_error) - /* "constraint/constraints.py":605 + /* "constraint/constraints.py":685 * """ * self._maxsum = maxsum * self._multipliers = multipliers # <<<<<<<<<<<<<< + * self._var_min = {} + * self._var_is_negative = {} +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < (0)) __PYX_ERR(0, 685, __pyx_L1_error) + + /* "constraint/constraints.py":686 + * self._maxsum = maxsum + * self._multipliers = multipliers + * self._var_min = {} # <<<<<<<<<<<<<< + * self._var_is_negative = {} + * +*/ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min, __pyx_t_1) < (0)) __PYX_ERR(0, 686, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":687 + * self._multipliers = multipliers + * self._var_min = {} + * self._var_is_negative = {} # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 605, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative, __pyx_t_1) < (0)) __PYX_ERR(0, 687, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":595 + /* "constraint/constraints.py":675 * """ * - * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, maxsum: int | float, multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -15878,6 +17652,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("constraint.constraints.MaxSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -15886,12 +17661,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ return __pyx_r; } -/* "constraint/constraints.py":607 - * self._multipliers = multipliers +/* "constraint/constraints.py":689 + * self._var_is_negative = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) */ /* Python wrapper */ @@ -15937,50 +17712,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 607, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 689, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 607, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 689, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 607, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 689, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 607, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 689, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 607, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 689, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 607, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 689, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 607, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 689, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 607, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 689, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 607, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 689, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 607, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 689, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 607, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 689, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 607, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 689, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 607, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 689, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -15990,7 +17765,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 607, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 689, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16001,9 +17776,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 607, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 607, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 607, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 689, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 689, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 689, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -16022,187 +17797,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10preProcess_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "constraint/constraints.py":614 - * variable_with_negative = None - * for variable in variables: - * contains_negative = any(value < 0 for value in domains[variable]) # <<<<<<<<<<<<<< - * variable_contains_negative.append(contains_negative) - * if contains_negative: -*/ - -static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_10preProcess_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 614, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; - __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_16MaxSumConstraint_10preProcess_2generator5, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint_preProcess_loca, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.MaxSumConstraint.preProcess.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10preProcess_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("genexpr", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 614, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 614, __pyx_L1_error) } - if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { - __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 614, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); - ++__pyx_t_2; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 614, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); - #endif - ++__pyx_t_2; - } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error) - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 614, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_value, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_5) { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - } - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - if (__Pyx_PyErr_Occurred()) { - __Pyx_Generator_Replace_StopIteration(0); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "constraint/constraints.py":607 - * self._multipliers = multipliers - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * -*/ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints) { - PyObject *__pyx_v_variable_contains_negative = 0; - PyObject *__pyx_v_variable_with_negative = NULL; - PyObject *__pyx_v_variable = NULL; - PyObject *__pyx_v_contains_negative = NULL; PyObject *__pyx_v_multipliers = NULL; PyObject *__pyx_v_maxsum = NULL; + PyObject *__pyx_v_variable = NULL; PyObject *__pyx_v_multiplier = NULL; PyObject *__pyx_v_domain = NULL; + PyObject *__pyx_v_other_vars_min = NULL; PyObject *__pyx_v_value = NULL; - PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10preProcess_2generator5 = 0; + PyObject *__pyx_9genexpr12__pyx_v_variable = NULL; + PyObject *__pyx_9genexpr12__pyx_v_multiplier = NULL; + PyObject *__pyx_9genexpr13__pyx_v_variable = NULL; + PyObject *__pyx_9genexpr13__pyx_v_multiplier = NULL; + PyObject *__pyx_9genexpr14__pyx_v_variable = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -16210,31 +17818,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; size_t __pyx_t_5; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); - int __pyx_t_8; - int __pyx_t_9; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); - int __pyx_t_12; - Py_ssize_t __pyx_t_13; - PyObject *(*__pyx_t_14)(PyObject *); + Py_ssize_t __pyx_t_12; + PyObject *(*__pyx_t_13)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":608 + /* "constraint/constraints.py":690 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< - * - * # check if there are any negative values in the associated variables + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) + * maxsum = self._maxsum */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 608, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -16251,777 +17858,764 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":611 + /* "constraint/constraints.py":691 + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) # <<<<<<<<<<<<<< + * maxsum = self._maxsum + * self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 +*/ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 691, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_7 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 691, __pyx_L1_error) + __pyx_t_4 = PyList_New(1 * ((__pyx_t_7<0) ? 0:__pyx_t_7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + { Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < __pyx_t_7; __pyx_temp++) { + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, __pyx_temp, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 691, __pyx_L1_error); + } + } + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_v_multipliers = __pyx_t_1; + __pyx_t_1 = 0; + + /* "constraint/constraints.py":692 + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) + * maxsum = self._maxsum # <<<<<<<<<<<<<< + * self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 * - * # check if there are any negative values in the associated variables - * variable_contains_negative: list[bool] = list() # <<<<<<<<<<<<<< - * variable_with_negative = None - * for variable in variables: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_variable_contains_negative = ((PyObject*)__pyx_t_1); + __pyx_v_maxsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":612 - * # check if there are any negative values in the associated variables - * variable_contains_negative: list[bool] = list() - * variable_with_negative = None # <<<<<<<<<<<<<< - * for variable in variables: - * contains_negative = any(value < 0 for value in domains[variable]) + /* "constraint/constraints.py":693 + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) + * maxsum = self._maxsum + * self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< + * + * # preprocess the domains to remove values that cannot contribute to the sum */ - __Pyx_INCREF(Py_None); - __pyx_v_variable_with_negative = Py_None; + { /* enter inner scope */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + } + if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { + __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 693, __pyx_L5_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 693, __pyx_L5_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_7; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 693, __pyx_L5_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L5_error) + } else { + __pyx_t_4 = __pyx_t_8(__pyx_t_2); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 693, __pyx_L5_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { + PyObject* sequence = __pyx_t_4; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 693, __pyx_L5_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_9); + } else { + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L5_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 693, __pyx_L5_error) + __Pyx_XGOTREF(__pyx_t_9); + } + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 693, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_9); + #endif + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 693, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 693, __pyx_L5_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + goto __pyx_L9_unpacking_done; + __pyx_L8_unpacking_failed:; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 693, __pyx_L5_error) + __pyx_L9_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_variable, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_multiplier, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr12__pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_3}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_9genexpr12__pyx_v_multiplier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_1, (PyObject*)__pyx_9genexpr12__pyx_v_variable, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 693, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_multiplier); __pyx_9genexpr12__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_variable); __pyx_9genexpr12__pyx_v_variable = 0; + goto __pyx_L11_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_multiplier); __pyx_9genexpr12__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_variable); __pyx_9genexpr12__pyx_v_variable = 0; + goto __pyx_L1_error; + __pyx_L11_exit_scope:; + } /* exit inner scope */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min, __pyx_t_1) < (0)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":613 - * variable_contains_negative: list[bool] = list() - * variable_with_negative = None - * for variable in variables: # <<<<<<<<<<<<<< - * contains_negative = any(value < 0 for value in domains[variable]) - * variable_contains_negative.append(contains_negative) + /* "constraint/constraints.py":696 + * + * # preprocess the domains to remove values that cannot contribute to the sum + * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< + * domain = domains[variable] + * other_vars_min = sum_other_vars(variables, variable, self._var_min) */ - if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_2 = NULL; + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 613, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 696, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 613, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 696, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 613, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 696, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); #endif - ++__pyx_t_6; + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_8(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 696, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 696, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); + } else { + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 613, __pyx_L1_error) - PyErr_Clear(); - } - break; - } + Py_ssize_t index = -1; + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 696, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); + index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + goto __pyx_L15_unpacking_done; + __pyx_L14_unpacking_failed:; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_11 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_L15_unpacking_done:; } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":614 - * variable_with_negative = None - * for variable in variables: - * contains_negative = any(value < 0 for value in domains[variable]) # <<<<<<<<<<<<<< - * variable_contains_negative.append(contains_negative) - * if contains_negative: + /* "constraint/constraints.py":697 + * # preprocess the domains to remove values that cannot contribute to the sum + * for variable, multiplier in zip(variables, multipliers): + * domain = domains[variable] # <<<<<<<<<<<<<< + * other_vars_min = sum_other_vars(variables, variable, self._var_min) + * for value in domain[:]: */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_pf_10constraint_11constraints_16MaxSumConstraint_10preProcess_genexpr(NULL, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_contains_negative, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":615 - * for variable in variables: - * contains_negative = any(value < 0 for value in domains[variable]) - * variable_contains_negative.append(contains_negative) # <<<<<<<<<<<<<< - * if contains_negative: - * if variable_with_negative is not None: + /* "constraint/constraints.py":698 + * for variable, multiplier in zip(variables, multipliers): + * domain = domains[variable] + * other_vars_min = sum_other_vars(variables, variable, self._var_min) # <<<<<<<<<<<<<< + * for value in domain[:]: + * if value * multiplier + other_vars_min > maxsum: */ - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_variable_contains_negative, __pyx_v_contains_negative); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 615, __pyx_L1_error) + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sum_other_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_4); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_5 = 0; + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_variables, __pyx_v_variable, __pyx_t_9}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_other_vars_min, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":616 - * contains_negative = any(value < 0 for value in domains[variable]) - * variable_contains_negative.append(contains_negative) - * if contains_negative: # <<<<<<<<<<<<<< - * if variable_with_negative is not None: - * # if more than one associated variables contain negative, we can't prune -*/ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_contains_negative); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 616, __pyx_L1_error) - if (__pyx_t_9) { - - /* "constraint/constraints.py":617 - * variable_contains_negative.append(contains_negative) - * if contains_negative: - * if variable_with_negative is not None: # <<<<<<<<<<<<<< - * # if more than one associated variables contain negative, we can't prune - * return + /* "constraint/constraints.py":699 + * domain = domains[variable] + * other_vars_min = sum_other_vars(variables, variable, self._var_min) + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value * multiplier + other_vars_min > maxsum: + * domain.remove(value) */ - __pyx_t_9 = (__pyx_v_variable_with_negative != Py_None); - if (__pyx_t_9) { + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); + __pyx_t_12 = 0; + __pyx_t_13 = NULL; + } else { + __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 699, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_13)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 699, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_12; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 699, __pyx_L1_error) + #endif + if (__pyx_t_12 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12)); + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); + #endif + ++__pyx_t_12; + } + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) + } else { + __pyx_t_1 = __pyx_t_13(__pyx_t_3); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 699, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/constraints.py":619 - * if variable_with_negative is not None: - * # if more than one associated variables contain negative, we can't prune - * return # <<<<<<<<<<<<<< - * variable_with_negative = variable + /* "constraint/constraints.py":700 + * other_vars_min = sum_other_vars(variables, variable, self._var_min) + * for value in domain[:]: + * if value * multiplier + other_vars_min > maxsum: # <<<<<<<<<<<<<< + * domain.remove(value) * */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyNumber_Add(__pyx_t_1, __pyx_v_other_vars_min); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_9, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 700, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { - /* "constraint/constraints.py":617 - * variable_contains_negative.append(contains_negative) - * if contains_negative: - * if variable_with_negative is not None: # <<<<<<<<<<<<<< - * # if more than one associated variables contain negative, we can't prune - * return + /* "constraint/constraints.py":701 + * for value in domain[:]: + * if value * multiplier + other_vars_min > maxsum: + * domain.remove(value) # <<<<<<<<<<<<<< + * + * # recalculate the min after pruning */ - } + __pyx_t_9 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_9); + __pyx_t_5 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_value}; + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":620 - * # if more than one associated variables contain negative, we can't prune - * return - * variable_with_negative = variable # <<<<<<<<<<<<<< + /* "constraint/constraints.py":700 + * other_vars_min = sum_other_vars(variables, variable, self._var_min) + * for value in domain[:]: + * if value * multiplier + other_vars_min > maxsum: # <<<<<<<<<<<<<< + * domain.remove(value) * - * # prune the associated variables of values > maxsum */ - __Pyx_INCREF(__pyx_v_variable); - __Pyx_DECREF_SET(__pyx_v_variable_with_negative, __pyx_v_variable); + } - /* "constraint/constraints.py":616 - * contains_negative = any(value < 0 for value in domains[variable]) - * variable_contains_negative.append(contains_negative) - * if contains_negative: # <<<<<<<<<<<<<< - * if variable_with_negative is not None: - * # if more than one associated variables contain negative, we can't prune + /* "constraint/constraints.py":699 + * domain = domains[variable] + * other_vars_min = sum_other_vars(variables, variable, self._var_min) + * for value in domain[:]: # <<<<<<<<<<<<<< + * if value * multiplier + other_vars_min > maxsum: + * domain.remove(value) */ } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":613 - * variable_contains_negative: list[bool] = list() - * variable_with_negative = None - * for variable in variables: # <<<<<<<<<<<<<< - * contains_negative = any(value < 0 for value in domains[variable]) - * variable_contains_negative.append(contains_negative) + /* "constraint/constraints.py":696 + * + * # preprocess the domains to remove values that cannot contribute to the sum + * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< + * domain = domains[variable] + * other_vars_min = sum_other_vars(variables, variable, self._var_min) */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":623 + /* "constraint/constraints.py":704 + * + * # recalculate the min after pruning + * self._var_min = { variable: min(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 # <<<<<<<<<<<<<< + * self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } * - * # prune the associated variables of values > maxsum - * multipliers = self._multipliers # <<<<<<<<<<<<<< - * maxsum = self._maxsum - * if multipliers: -*/ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_multipliers = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":624 - * # prune the associated variables of values > maxsum - * multipliers = self._multipliers - * maxsum = self._maxsum # <<<<<<<<<<<<<< - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): -*/ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_maxsum = __pyx_t_1; - __pyx_t_1 = 0; - - /* "constraint/constraints.py":625 - * multipliers = self._multipliers - * maxsum = self._maxsum - * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * if variable_with_negative is not None and variable_with_negative != variable: -*/ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 625, __pyx_L1_error) - if (__pyx_t_9) { - - /* "constraint/constraints.py":626 - * maxsum = self._maxsum - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * if variable_with_negative is not None and variable_with_negative != variable: - * continue */ - __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_2 = __pyx_builtin_zip; + { /* enter inner scope */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_3); } - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 704, __pyx_L23_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 704, __pyx_L23_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 704, __pyx_L23_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); #endif - ++__pyx_t_6; + ++__pyx_t_7; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L23_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { + __pyx_t_3 = __pyx_t_8(__pyx_t_1); + if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 704, __pyx_L23_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_1); - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; + __Pyx_GOTREF(__pyx_t_3); + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 626, __pyx_L1_error) + __PYX_ERR(0, 704, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_9); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 704, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); } #else - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 704, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 704, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); - index = 0; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; + index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L26_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 626, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 704, __pyx_L23_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L12_unpacking_done; - __pyx_L11_unpacking_failed:; + goto __pyx_L27_unpacking_done; + __pyx_L26_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 626, __pyx_L1_error) - __pyx_L12_unpacking_done:; + __PYX_ERR(0, 704, __pyx_L23_error) + __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); + __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_variable, __pyx_t_9); + __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_multiplier, __pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":627 - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): - * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< - * continue - * domain = domains[variable] -*/ - __pyx_t_12 = (__pyx_v_variable_with_negative != Py_None); - if (__pyx_t_12) { - } else { - __pyx_t_9 = __pyx_t_12; - goto __pyx_L14_bool_binop_done; - } - __pyx_t_1 = PyObject_RichCompare(__pyx_v_variable_with_negative, __pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 627, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __pyx_t_12; - __pyx_L14_bool_binop_done:; - if (__pyx_t_9) { - - /* "constraint/constraints.py":628 - * for variable, multiplier in zip(variables, multipliers): - * if variable_with_negative is not None and variable_with_negative != variable: - * continue # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: -*/ - goto __pyx_L9_continue; - - /* "constraint/constraints.py":627 - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): - * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< - * continue - * domain = domains[variable] -*/ - } - - /* "constraint/constraints.py":629 - * if variable_with_negative is not None and variable_with_negative != variable: - * continue - * domain = domains[variable] # <<<<<<<<<<<<<< - * for value in domain[:]: - * if value * multiplier > maxsum: -*/ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":630 - * continue - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value * multiplier > maxsum: - * domain.remove(value) -*/ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); - __pyx_t_13 = 0; - __pyx_t_14 = NULL; - } else { - __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 630, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 630, __pyx_L1_error) - #endif - if (__pyx_t_13 >= __pyx_temp) break; - } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_13); - ++__pyx_t_13; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 630, __pyx_L1_error) - #endif - if (__pyx_t_13 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); - #endif - ++__pyx_t_13; - } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error) - } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 630, __pyx_L1_error) - PyErr_Clear(); - } - break; - } + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr13__pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 704, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = (__pyx_t_12 > 0); + if (__pyx_t_6) { + __pyx_t_9 = NULL; + __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr13__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 704, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_5 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_4); } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; - - /* "constraint/constraints.py":631 - * domain = domains[variable] - * for value in domain[:]: - * if value * multiplier > maxsum: # <<<<<<<<<<<<<< - * domain.remove(value) - * else: -*/ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_t_10 = PyNumber_Multiply(__pyx_t_4, __pyx_9genexpr13__pyx_v_multiplier); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 704, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_9) { - - /* "constraint/constraints.py":632 - * for value in domain[:]: - * if value * multiplier > maxsum: - * domain.remove(value) # <<<<<<<<<<<<<< - * else: - * for variable in variables: -*/ - __pyx_t_1 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "constraint/constraints.py":631 - * domain = domains[variable] - * for value in domain[:]: - * if value * multiplier > maxsum: # <<<<<<<<<<<<<< - * domain.remove(value) - * else: -*/ - } - - /* "constraint/constraints.py":630 - * continue - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value * multiplier > maxsum: - * domain.remove(value) -*/ + __pyx_t_3 = __pyx_t_10; + __pyx_t_10 = 0; + } else { + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_t_3 = __pyx_mstate_global->__pyx_int_0; } + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr13__pyx_v_variable, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 704, __pyx_L23_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":626 - * maxsum = self._maxsum - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< - * if variable_with_negative is not None and variable_with_negative != variable: - * continue -*/ - __pyx_L9_continue:; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "constraint/constraints.py":625 - * multipliers = self._multipliers - * maxsum = self._maxsum - * if multipliers: # <<<<<<<<<<<<<< - * for variable, multiplier in zip(variables, multipliers): - * if variable_with_negative is not None and variable_with_negative != variable: -*/ - goto __pyx_L8; - } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_multiplier); __pyx_9genexpr13__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_variable); __pyx_9genexpr13__pyx_v_variable = 0; + goto __pyx_L29_exit_scope; + __pyx_L23_error:; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_multiplier); __pyx_9genexpr13__pyx_v_multiplier = 0; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_variable); __pyx_9genexpr13__pyx_v_variable = 0; + goto __pyx_L1_error; + __pyx_L29_exit_scope:; + } /* exit inner scope */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min, __pyx_t_2) < (0)) __PYX_ERR(0, 704, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":634 - * domain.remove(value) - * else: - * for variable in variables: # <<<<<<<<<<<<<< - * if variable_with_negative is not None and variable_with_negative != variable: - * continue + /* "constraint/constraints.py":705 + * # recalculate the min after pruning + * self._var_min = { variable: min(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + * self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } # <<<<<<<<<<<<<< + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 */ - /*else*/ { + { /* enter inner scope */ + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L32_error) + __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_2 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L32_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 705, __pyx_L32_error) } for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 634, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 705, __pyx_L32_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_7; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 634, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 705, __pyx_L32_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); #endif - ++__pyx_t_6; + ++__pyx_t_7; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L32_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_2); + __pyx_t_3 = __pyx_t_8(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 634, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 705, __pyx_L32_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":635 - * else: - * for variable in variables: - * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< - * continue - * domain = domains[variable] -*/ - __pyx_t_12 = (__pyx_v_variable_with_negative != Py_None); - if (__pyx_t_12) { - } else { - __pyx_t_9 = __pyx_t_12; - goto __pyx_L24_bool_binop_done; - } - __pyx_t_3 = PyObject_RichCompare(__pyx_v_variable_with_negative, __pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 635, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __pyx_t_12; - __pyx_L24_bool_binop_done:; - if (__pyx_t_9) { - - /* "constraint/constraints.py":636 - * for variable in variables: - * if variable_with_negative is not None and variable_with_negative != variable: - * continue # <<<<<<<<<<<<<< - * domain = domains[variable] - * for value in domain[:]: -*/ - goto __pyx_L21_continue; - - /* "constraint/constraints.py":635 - * else: - * for variable in variables: - * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< - * continue - * domain = domains[variable] -*/ - } - - /* "constraint/constraints.py":637 - * if variable_with_negative is not None and variable_with_negative != variable: - * continue - * domain = domains[variable] # <<<<<<<<<<<<<< - * for value in domain[:]: - * if value > maxsum: -*/ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_variable, __pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":638 - * continue - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > maxsum: - * domain.remove(value) -*/ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L32_error) __Pyx_GOTREF(__pyx_t_3); - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); - __pyx_t_13 = 0; - __pyx_t_14 = NULL; - } else { - __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 638, __pyx_L1_error) - } + __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_9genexpr14__pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 705, __pyx_L32_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_10, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L32_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_9genexpr14__pyx_v_variable, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 705, __pyx_L32_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 638, __pyx_L1_error) - #endif - if (__pyx_t_13 >= __pyx_temp) break; - } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_13); - ++__pyx_t_13; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 638, __pyx_L1_error) - #endif - if (__pyx_t_13 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13)); - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); - #endif - ++__pyx_t_13; - } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 638, __pyx_L1_error) - } else { - __pyx_t_3 = __pyx_t_14(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 638, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":639 - * domain = domains[variable] - * for value in domain[:]: - * if value > maxsum: # <<<<<<<<<<<<<< - * domain.remove(value) - * -*/ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_9) { - - /* "constraint/constraints.py":640 - * for value in domain[:]: - * if value > maxsum: - * domain.remove(value) # <<<<<<<<<<<<<< - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 -*/ - __pyx_t_1 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":639 - * domain = domains[variable] - * for value in domain[:]: - * if value > maxsum: # <<<<<<<<<<<<<< - * domain.remove(value) - * -*/ - } - - /* "constraint/constraints.py":638 - * continue - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if value > maxsum: - * domain.remove(value) -*/ - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "constraint/constraints.py":634 - * domain.remove(value) - * else: - * for variable in variables: # <<<<<<<<<<<<<< - * if variable_with_negative is not None and variable_with_negative != variable: - * continue -*/ - __pyx_L21_continue:; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_L8:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_variable); __pyx_9genexpr14__pyx_v_variable = 0; + goto __pyx_L36_exit_scope; + __pyx_L32_error:; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_variable); __pyx_9genexpr14__pyx_v_variable = 0; + goto __pyx_L1_error; + __pyx_L36_exit_scope:; + } /* exit inner scope */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative, __pyx_t_2) < (0)) __PYX_ERR(0, 705, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":607 - * self._multipliers = multipliers + /* "constraint/constraints.py":689 + * self._var_is_negative = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) */ /* function exit code */ @@ -17032,27 +18626,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("constraint.constraints.MaxSumConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_variable_contains_negative); - __Pyx_XDECREF(__pyx_v_variable_with_negative); - __Pyx_XDECREF(__pyx_v_variable); - __Pyx_XDECREF(__pyx_v_contains_negative); __Pyx_XDECREF(__pyx_v_multipliers); __Pyx_XDECREF(__pyx_v_maxsum); + __Pyx_XDECREF(__pyx_v_variable); __Pyx_XDECREF(__pyx_v_multiplier); __Pyx_XDECREF(__pyx_v_domain); + __Pyx_XDECREF(__pyx_v_other_vars_min); __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10preProcess_2generator5); + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_variable); + __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_multiplier); + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_variable); + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_multiplier); + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_variable); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":642 - * domain.remove(value) +/* "constraint/constraints.py":707 + * self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers @@ -17102,53 +18699,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 642, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 707, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 642, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 707, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 642, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 707, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 642, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 707, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 642, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 707, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 642, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 707, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 642, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 707, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 642, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 707, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 642, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 707, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 642, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 707, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 642, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 707, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 642, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 707, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 642, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 707, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -17162,7 +18759,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 642, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 707, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17173,8 +18770,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 642, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 642, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 707, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 707, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -17198,6 +18795,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ PyObject *__pyx_v_multipliers = NULL; PyObject *__pyx_v_maxsum = NULL; PyObject *__pyx_v_sum = NULL; + PyObject *__pyx_v_min_sum_missing = NULL; + int __pyx_v_missing; + int __pyx_v_missing_negative; PyObject *__pyx_v_variable = NULL; PyObject *__pyx_v_multiplier = NULL; PyObject *__pyx_v_domain = NULL; @@ -17207,128 +18807,153 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); + size_t __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *(*__pyx_t_6)(PyObject *); + PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); - Py_ssize_t __pyx_t_11; - PyObject *(*__pyx_t_12)(PyObject *); - int __pyx_t_13; + int __pyx_t_11; + Py_ssize_t __pyx_t_12; + PyObject *(*__pyx_t_13)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":643 + /* "constraint/constraints.py":708 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers # <<<<<<<<<<<<<< * maxsum = self._maxsum * sum = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":644 + /* "constraint/constraints.py":709 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers * maxsum = self._maxsum # <<<<<<<<<<<<<< * sum = 0 - * if multipliers: + * min_sum_missing = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxsum = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":645 + /* "constraint/constraints.py":710 * multipliers = self._multipliers * maxsum = self._maxsum * sum = 0 # <<<<<<<<<<<<<< - * if multipliers: - * for variable, multiplier in zip(variables, multipliers): + * min_sum_missing = 0 + * missing = False */ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":646 + /* "constraint/constraints.py":711 * maxsum = self._maxsum * sum = 0 + * min_sum_missing = 0 # <<<<<<<<<<<<<< + * missing = False + * missing_negative = False +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_min_sum_missing = __pyx_mstate_global->__pyx_int_0; + + /* "constraint/constraints.py":712 + * sum = 0 + * min_sum_missing = 0 + * missing = False # <<<<<<<<<<<<<< + * missing_negative = False + * if multipliers: +*/ + __pyx_v_missing = 0; + + /* "constraint/constraints.py":713 + * min_sum_missing = 0 + * missing = False + * missing_negative = False # <<<<<<<<<<<<<< + * if multipliers: + * for variable, multiplier in zip(variables, multipliers): +*/ + __pyx_v_missing_negative = 0; + + /* "constraint/constraints.py":714 + * missing = False + * missing_negative = False * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 714, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":647 - * sum = 0 + /* "constraint/constraints.py":715 + * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] * multiplier */ __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_4 = __pyx_builtin_zip; - __pyx_t_5 = 1; + __pyx_t_4 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 715, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 647, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 715, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 647, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 715, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); #endif - ++__pyx_t_6; + ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_4); + __pyx_t_1 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 647, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 715, __pyx_L1_error) PyErr_Clear(); } break; @@ -17341,40 +18966,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 647, __pyx_L1_error) + __PYX_ERR(0, 715, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 715, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 647, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); + index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 647, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 715, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; @@ -17382,119 +19007,184 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 647, __pyx_L1_error) + __PYX_ERR(0, 715, __pyx_L1_error) __pyx_L7_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); + __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":648 + /* "constraint/constraints.py":716 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier - * if isinstance(sum, float): + * else: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 648, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 716, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":649 + /* "constraint/constraints.py":717 * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< - * if isinstance(sum, float): - * sum = round(sum, 10) + * else: + * min_sum_missing += self._var_min[variable] */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 649, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":648 + /* "constraint/constraints.py":716 * if multipliers: * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier + * else: +*/ + goto __pyx_L8; + } + + /* "constraint/constraints.py":719 + * sum += assignments[variable] * multiplier + * else: + * min_sum_missing += self._var_min[variable] # <<<<<<<<<<<<<< + * missing = True + * if self._var_is_negative[variable]: +*/ + /*else*/ { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_min_sum_missing, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF_SET(__pyx_v_min_sum_missing, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/constraints.py":720 + * else: + * min_sum_missing += self._var_min[variable] + * missing = True # <<<<<<<<<<<<<< + * if self._var_is_negative[variable]: + * missing_negative = True +*/ + __pyx_v_missing = 1; + + /* "constraint/constraints.py":721 + * min_sum_missing += self._var_min[variable] + * missing = True + * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< + * missing_negative = True + * if isinstance(sum, float): +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_2) { + + /* "constraint/constraints.py":722 + * missing = True + * if self._var_is_negative[variable]: + * missing_negative = True # <<<<<<<<<<<<<< * if isinstance(sum, float): + * sum = round(sum, 10) */ + __pyx_v_missing_negative = 1; + + /* "constraint/constraints.py":721 + * min_sum_missing += self._var_min[variable] + * missing = True + * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< + * missing_negative = True + * if isinstance(sum, float): +*/ + } } + __pyx_L8:; - /* "constraint/constraints.py":647 - * sum = 0 + /* "constraint/constraints.py":715 + * missing_negative = False * if multipliers: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] * multiplier */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":650 - * if variable in assignments: - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":723 + * if self._var_is_negative[variable]: + * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * if sum > maxsum: + * if sum + min_sum_missing > maxsum: */ __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { - /* "constraint/constraints.py":651 - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":724 + * missing_negative = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< - * if sum > maxsum: + * if sum + min_sum_missing > maxsum: * return False */ - __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_8 = __pyx_builtin_round; - __pyx_t_5 = 1; + __pyx_t_8 = NULL; + __pyx_t_4 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":650 - * if variable in assignments: - * sum += assignments[variable] * multiplier + /* "constraint/constraints.py":723 + * if self._var_is_negative[variable]: + * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * if sum > maxsum: + * if sum + min_sum_missing > maxsum: */ } - /* "constraint/constraints.py":652 + /* "constraint/constraints.py":725 * if isinstance(sum, float): * sum = round(sum, 10) - * if sum > maxsum: # <<<<<<<<<<<<<< + * if sum + min_sum_missing > maxsum: # <<<<<<<<<<<<<< * return False - * if forwardcheck: + * if forwardcheck and missing and not missing_negative: */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 725, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":653 + /* "constraint/constraints.py":726 * sum = round(sum, 10) - * if sum > maxsum: + * if sum + min_sum_missing > maxsum: * return False # <<<<<<<<<<<<<< - * if forwardcheck: + * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): */ __Pyx_XDECREF(__pyx_r); @@ -17502,271 +19192,281 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":652 + /* "constraint/constraints.py":725 * if isinstance(sum, float): * sum = round(sum, 10) - * if sum > maxsum: # <<<<<<<<<<<<<< + * if sum + min_sum_missing > maxsum: # <<<<<<<<<<<<<< * return False - * if forwardcheck: + * if forwardcheck and missing and not missing_negative: */ } - /* "constraint/constraints.py":654 - * if sum > maxsum: + /* "constraint/constraints.py":727 + * if sum + min_sum_missing > maxsum: * return False - * if forwardcheck: # <<<<<<<<<<<<<< + * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 727, __pyx_L1_error) + if (__pyx_t_11) { + } else { + __pyx_t_2 = __pyx_t_11; + goto __pyx_L14_bool_binop_done; + } + if (__pyx_v_missing) { + } else { + __pyx_t_2 = __pyx_v_missing; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_11 = (!__pyx_v_missing_negative); + __pyx_t_2 = __pyx_t_11; + __pyx_L14_bool_binop_done:; if (__pyx_t_2) { - /* "constraint/constraints.py":655 + /* "constraint/constraints.py":728 * return False - * if forwardcheck: + * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] */ - __pyx_t_8 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_1 = __pyx_builtin_zip; - __pyx_t_5 = 1; + __pyx_t_3 = NULL; + __pyx_t_4 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_variables, __pyx_v_multipliers}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_variables, __pyx_v_multipliers}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { + __pyx_t_3 = __pyx_t_8; __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 728, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 655, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 728, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 655, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 728, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); #endif - ++__pyx_t_6; + ++__pyx_t_5; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 728, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { + __pyx_t_8 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 655, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 728, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_4); - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; + __Pyx_GOTREF(__pyx_t_8); + if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { + PyObject* sequence = __pyx_t_8; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 655, __pyx_L1_error) + __PYX_ERR(0, 728, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_8); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 655, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); } #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 728, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L15_unpacking_failed; - __Pyx_GOTREF(__pyx_t_8); - index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L15_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 655, __pyx_L1_error) + index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L19_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L19_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 728, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L16_unpacking_done; - __pyx_L15_unpacking_failed:; + goto __pyx_L20_unpacking_done; + __pyx_L19_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 655, __pyx_L1_error) - __pyx_L16_unpacking_done:; + __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_L20_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":656 - * if forwardcheck: + /* "constraint/constraints.py":729 + * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 656, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 729, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":657 + /* "constraint/constraints.py":730 * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if sum + value * multiplier > maxsum: */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 730, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":658 + /* "constraint/constraints.py":731 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value * multiplier > maxsum: * domain.hideValue(value) */ - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); - __pyx_t_11 = 0; - __pyx_t_12 = NULL; + __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 731, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { + __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); + __pyx_t_12 = 0; + __pyx_t_13 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 658, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 731, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 731, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_13)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 658, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 731, __pyx_L1_error) #endif - if (__pyx_t_11 >= __pyx_temp) break; + if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_11); - ++__pyx_t_11; + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_12; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 658, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 731, __pyx_L1_error) #endif - if (__pyx_t_11 >= __pyx_temp) break; + if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_12); #endif - ++__pyx_t_11; + ++__pyx_t_12; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 731, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_12(__pyx_t_3); - if (unlikely(!__pyx_t_4)) { + __pyx_t_8 = __pyx_t_13(__pyx_t_7); + if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 658, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 731, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":659 + /* "constraint/constraints.py":732 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_4 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyNumber_Add(__pyx_v_sum, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_sum, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 732, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 659, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":660 + /* "constraint/constraints.py":733 * for value in domain[:]: * if sum + value * multiplier > maxsum: * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False */ - __pyx_t_8 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_8); - __pyx_t_5 = 0; + __pyx_t_1 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; + __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 733, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":659 + /* "constraint/constraints.py":732 * domain = domains[variable] * for value in domain[:]: * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< @@ -17775,7 +19475,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":658 + /* "constraint/constraints.py":731 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -17783,20 +19483,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * domain.hideValue(value) */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":661 + /* "constraint/constraints.py":734 * if sum + value * multiplier > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * else: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 661, __pyx_L1_error) - __pyx_t_13 = (!__pyx_t_2); - if (__pyx_t_13) { + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 734, __pyx_L1_error) + __pyx_t_11 = (!__pyx_t_2); + if (__pyx_t_11) { - /* "constraint/constraints.py":662 + /* "constraint/constraints.py":735 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -17806,10 +19506,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "constraint/constraints.py":661 + /* "constraint/constraints.py":734 * if sum + value * multiplier > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -17818,8 +19518,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":656 - * if forwardcheck: + /* "constraint/constraints.py":729 + * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] @@ -17827,28 +19527,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":655 + /* "constraint/constraints.py":728 * return False - * if forwardcheck: + * if forwardcheck and missing and not missing_negative: * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":654 - * if sum > maxsum: + /* "constraint/constraints.py":727 + * if sum + min_sum_missing > maxsum: * return False - * if forwardcheck: # <<<<<<<<<<<<<< + * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: */ } - /* "constraint/constraints.py":646 - * maxsum = self._maxsum - * sum = 0 + /* "constraint/constraints.py":714 + * missing = False + * missing_negative = False * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: @@ -17856,7 +19556,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ goto __pyx_L3; } - /* "constraint/constraints.py":664 + /* "constraint/constraints.py":737 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -17865,92 +19565,157 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + __pyx_t_3 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 664, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 737, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 664, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 737, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 664, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 737, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); #endif - ++__pyx_t_6; + ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 737, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_7 = __pyx_t_6(__pyx_t_3); + if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 664, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 737, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/constraints.py":665 + /* "constraint/constraints.py":738 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] - * if isinstance(sum, float): + * else: */ - __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 665, __pyx_L1_error) - if (__pyx_t_13) { + __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 738, __pyx_L1_error) + if (__pyx_t_11) { - /* "constraint/constraints.py":666 + /* "constraint/constraints.py":739 * for variable in variables: * if variable in assignments: * sum += assignments[variable] # <<<<<<<<<<<<<< - * if isinstance(sum, float): - * sum = round(sum, 10) + * else: + * min_sum_missing += self._var_min[variable] */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 739, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":665 + /* "constraint/constraints.py":738 * else: * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] + * else: +*/ + goto __pyx_L30; + } + + /* "constraint/constraints.py":741 + * sum += assignments[variable] + * else: + * min_sum_missing += self._var_min[variable] # <<<<<<<<<<<<<< + * missing = True + * if self._var_is_negative[variable]: +*/ + /*else*/ { + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_min); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_min_sum_missing, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_min_sum_missing, __pyx_t_8); + __pyx_t_8 = 0; + + /* "constraint/constraints.py":742 + * else: + * min_sum_missing += self._var_min[variable] + * missing = True # <<<<<<<<<<<<<< + * if self._var_is_negative[variable]: + * missing_negative = True +*/ + __pyx_v_missing = 1; + + /* "constraint/constraints.py":743 + * min_sum_missing += self._var_min[variable] + * missing = True + * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< + * missing_negative = True * if isinstance(sum, float): */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_var_is_negative); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 743, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_11) { + + /* "constraint/constraints.py":744 + * missing = True + * if self._var_is_negative[variable]: + * missing_negative = True # <<<<<<<<<<<<<< + * if isinstance(sum, float): + * sum = round(sum, 10) +*/ + __pyx_v_missing_negative = 1; + + /* "constraint/constraints.py":743 + * min_sum_missing += self._var_min[variable] + * missing = True + * if self._var_is_negative[variable]: # <<<<<<<<<<<<<< + * missing_negative = True + * if isinstance(sum, float): +*/ + } } + __pyx_L30:; - /* "constraint/constraints.py":664 + /* "constraint/constraints.py":737 * return False * else: * for variable in variables: # <<<<<<<<<<<<<< @@ -17958,66 +19723,66 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * sum += assignments[variable] */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":667 - * if variable in assignments: - * sum += assignments[variable] + /* "constraint/constraints.py":745 + * if self._var_is_negative[variable]: + * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * if sum > maxsum: + * if sum + min_sum_missing > maxsum: */ - __pyx_t_13 = PyFloat_Check(__pyx_v_sum); - if (__pyx_t_13) { + __pyx_t_11 = PyFloat_Check(__pyx_v_sum); + if (__pyx_t_11) { - /* "constraint/constraints.py":668 - * sum += assignments[variable] + /* "constraint/constraints.py":746 + * missing_negative = True * if isinstance(sum, float): * sum = round(sum, 10) # <<<<<<<<<<<<<< - * if sum > maxsum: + * if sum + min_sum_missing > maxsum: * return False */ - __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_3 = __pyx_builtin_round; - __pyx_t_5 = 1; + __pyx_t_7 = NULL; + __pyx_t_4 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_sum, __pyx_mstate_global->__pyx_int_10}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_sum, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":667 - * if variable in assignments: - * sum += assignments[variable] + /* "constraint/constraints.py":745 + * if self._var_is_negative[variable]: + * missing_negative = True * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) - * if sum > maxsum: + * if sum + min_sum_missing > maxsum: */ } - /* "constraint/constraints.py":669 + /* "constraint/constraints.py":747 * if isinstance(sum, float): * sum = round(sum, 10) - * if sum > maxsum: # <<<<<<<<<<<<<< + * if sum + min_sum_missing > maxsum: # <<<<<<<<<<<<<< * return False - * if forwardcheck: + * if forwardcheck and missing and not missing_negative: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 669, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_13) { + __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_min_sum_missing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 747, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 747, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_11) { - /* "constraint/constraints.py":670 + /* "constraint/constraints.py":748 * sum = round(sum, 10) - * if sum > maxsum: + * if sum + min_sum_missing > maxsum: * return False # <<<<<<<<<<<<<< - * if forwardcheck: + * if forwardcheck and missing and not missing_negative: * for variable in variables: */ __Pyx_XDECREF(__pyx_r); @@ -18025,75 +19790,88 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":669 + /* "constraint/constraints.py":747 * if isinstance(sum, float): * sum = round(sum, 10) - * if sum > maxsum: # <<<<<<<<<<<<<< + * if sum + min_sum_missing > maxsum: # <<<<<<<<<<<<<< * return False - * if forwardcheck: + * if forwardcheck and missing and not missing_negative: */ } - /* "constraint/constraints.py":671 - * if sum > maxsum: + /* "constraint/constraints.py":749 + * if sum + min_sum_missing > maxsum: * return False - * if forwardcheck: # <<<<<<<<<<<<<< + * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: */ - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 671, __pyx_L1_error) - if (__pyx_t_13) { + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 749, __pyx_L1_error) + if (__pyx_t_2) { + } else { + __pyx_t_11 = __pyx_t_2; + goto __pyx_L36_bool_binop_done; + } + if (__pyx_v_missing) { + } else { + __pyx_t_11 = __pyx_v_missing; + goto __pyx_L36_bool_binop_done; + } + __pyx_t_2 = (!__pyx_v_missing_negative); + __pyx_t_11 = __pyx_t_2; + __pyx_L36_bool_binop_done:; + if (__pyx_t_11) { - /* "constraint/constraints.py":672 + /* "constraint/constraints.py":750 * return False - * if forwardcheck: + * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] */ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + __pyx_t_7 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_7); + __pyx_t_5 = 0; + __pyx_t_6 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 672, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 750, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 750, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_6)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 672, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 750, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 672, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 750, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); #endif - ++__pyx_t_6; + ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_1); + __pyx_t_3 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 672, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 750, __pyx_L1_error) PyErr_Clear(); } break; @@ -18103,81 +19881,81 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":673 - * if forwardcheck: + /* "constraint/constraints.py":751 + * if forwardcheck and missing and not missing_negative: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: */ - __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 673, __pyx_L1_error) - if (__pyx_t_13) { + __pyx_t_11 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 751, __pyx_L1_error) + if (__pyx_t_11) { - /* "constraint/constraints.py":674 + /* "constraint/constraints.py":752 * for variable in variables: * if variable not in assignments: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if sum + value > maxsum: */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":675 + /* "constraint/constraints.py":753 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value > maxsum: * domain.hideValue(value) */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); - __pyx_t_11 = 0; - __pyx_t_12 = NULL; + __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); + __pyx_t_12 = 0; + __pyx_t_13 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 753, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 753, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(!__pyx_t_13)) { + if (likely(PyList_CheckExact(__pyx_t_8))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 675, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 753, __pyx_L1_error) #endif - if (__pyx_t_11 >= __pyx_temp) break; + if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_11); - ++__pyx_t_11; + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_12; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 675, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 753, __pyx_L1_error) #endif - if (__pyx_t_11 >= __pyx_temp) break; + if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_12); #endif - ++__pyx_t_11; + ++__pyx_t_12; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_12(__pyx_t_4); + __pyx_t_3 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 675, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 753, __pyx_L1_error) PyErr_Clear(); } break; @@ -18187,22 +19965,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":676 + /* "constraint/constraints.py":754 * domain = domains[variable] * for value in domain[:]: * if sum + value > maxsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 676, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__pyx_t_13) { + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 754, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_11) { - /* "constraint/constraints.py":677 + /* "constraint/constraints.py":755 * for value in domain[:]: * if sum + value > maxsum: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -18211,17 +19989,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ __pyx_t_3 = __pyx_v_domain; __Pyx_INCREF(__pyx_t_3); - __pyx_t_5 = 0; + __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 677, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":676 + /* "constraint/constraints.py":754 * domain = domains[variable] * for value in domain[:]: * if sum + value > maxsum: # <<<<<<<<<<<<<< @@ -18230,7 +20008,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":675 + /* "constraint/constraints.py":753 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -18238,20 +20016,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * domain.hideValue(value) */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":678 + /* "constraint/constraints.py":756 * if sum + value > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 678, __pyx_L1_error) - __pyx_t_2 = (!__pyx_t_13); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 756, __pyx_L1_error) + __pyx_t_2 = (!__pyx_t_11); if (__pyx_t_2) { - /* "constraint/constraints.py":679 + /* "constraint/constraints.py":757 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -18261,10 +20039,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/constraints.py":678 + /* "constraint/constraints.py":756 * if sum + value > maxsum: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -18273,8 +20051,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":673 - * if forwardcheck: + /* "constraint/constraints.py":751 + * if forwardcheck and missing and not missing_negative: * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] @@ -18282,20 +20060,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ */ } - /* "constraint/constraints.py":672 + /* "constraint/constraints.py":750 * return False - * if forwardcheck: + * if forwardcheck and missing and not missing_negative: * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":671 - * if sum > maxsum: + /* "constraint/constraints.py":749 + * if sum + min_sum_missing > maxsum: * return False - * if forwardcheck: # <<<<<<<<<<<<<< + * if forwardcheck and missing and not missing_negative: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: */ @@ -18303,7 +20081,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } __pyx_L3:; - /* "constraint/constraints.py":680 + /* "constraint/constraints.py":758 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -18315,8 +20093,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":642 - * domain.remove(value) + /* "constraint/constraints.py":707 + * self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers @@ -18327,7 +20105,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("constraint.constraints.MaxSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -18336,6 +20114,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __Pyx_XDECREF(__pyx_v_multipliers); __Pyx_XDECREF(__pyx_v_maxsum); __Pyx_XDECREF(__pyx_v_sum); + __Pyx_XDECREF(__pyx_v_min_sum_missing); __Pyx_XDECREF(__pyx_v_variable); __Pyx_XDECREF(__pyx_v_multiplier); __Pyx_XDECREF(__pyx_v_domain); @@ -18345,10 +20124,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ return __pyx_r; } -/* "constraint/constraints.py":694 +/* "constraint/constraints.py":778 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -18396,47 +20175,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_target_var,&__pyx_mstate_global->__pyx_n_u_sum_vars,&__pyx_mstate_global->__pyx_n_u_multipliers,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 694, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 778, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 694, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 778, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 694, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 778, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 694, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 778, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 694, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 778, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 694, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 778, __pyx_L3_error) if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 694, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, i); __PYX_ERR(0, 778, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 694, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 778, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 694, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 778, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 694, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 778, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 694, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 778, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -18449,7 +20228,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 694, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 778, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18460,7 +20239,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 694, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 778, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_target_var, __pyx_v_sum_vars, __pyx_v_multipliers); /* function exit code */ @@ -18479,9 +20258,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_8__init___2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_8__init___2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":710 +/* "constraint/constraints.py":794 * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." # <<<<<<<<<<<<<< @@ -18490,18 +20269,18 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ */ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_8__init___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 710, __pyx_L1_error) + __PYX_ERR(0, 794, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -18509,7 +20288,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_8__init___2generator6, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint___init, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_8__init___2generator5, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint___init, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -18525,9 +20304,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_8__init___2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_8__init___2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -18547,16 +20326,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 710, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 710, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 794, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 794, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 794, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -18564,17 +20343,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 710, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 794, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 710, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 794, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -18585,13 +20364,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 710, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 710, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 794, __pyx_L1_error) PyErr_Clear(); } break; @@ -18649,16 +20428,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":694 +/* "constraint/constraints.py":778 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_target_var, PyObject *__pyx_v_sum_vars, PyObject *__pyx_v_multipliers) { - PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_8__init___2generator6 = 0; + PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_8__init___2generator5 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -18671,44 +20450,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":704 + /* "constraint/constraints.py":788 * summed to match the last variable. * """ * self.target_var = target_var # <<<<<<<<<<<<<< * self.sum_vars = sum_vars * self._multipliers = multipliers */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < 0) __PYX_ERR(0, 704, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < (0)) __PYX_ERR(0, 788, __pyx_L1_error) - /* "constraint/constraints.py":705 + /* "constraint/constraints.py":789 * """ * self.target_var = target_var * self.sum_vars = sum_vars # <<<<<<<<<<<<<< * self._multipliers = multipliers * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_v_sum_vars) < 0) __PYX_ERR(0, 705, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_v_sum_vars) < (0)) __PYX_ERR(0, 789, __pyx_L1_error) - /* "constraint/constraints.py":706 + /* "constraint/constraints.py":790 * self.target_var = target_var * self.sum_vars = sum_vars * self._multipliers = multipliers # <<<<<<<<<<<<<< * * if multipliers: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 706, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < (0)) __PYX_ERR(0, 790, __pyx_L1_error) - /* "constraint/constraints.py":708 + /* "constraint/constraints.py":792 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 792, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/constraints.py":709 + /* "constraint/constraints.py":793 * * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." # <<<<<<<<<<<<<< @@ -18717,19 +20496,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_2 = PyObject_Length(__pyx_v_multipliers); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 709, __pyx_L1_error) - __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 709, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_v_multipliers); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 793, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_sum_vars); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 793, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 == (__pyx_t_3 + 1)); if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_Multipliers_must_match_sum_varia, 0, 0); - __PYX_ERR(0, 709, __pyx_L1_error) + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_match_sum_varia, 0, 0); + __PYX_ERR(0, 793, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 709, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 793, __pyx_L1_error) #endif - /* "constraint/constraints.py":710 + /* "constraint/constraints.py":794 * if multipliers: * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." # <<<<<<<<<<<<<< @@ -18738,23 +20517,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_4 = __pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_8__init___genexpr(NULL, __pyx_v_multipliers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_8__init___genexpr(NULL, __pyx_v_multipliers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_Multipliers_must_be_numbers, 0, 0); - __PYX_ERR(0, 710, __pyx_L1_error) + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Multipliers_must_be_numbers, 0, 0); + __PYX_ERR(0, 794, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 710, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 794, __pyx_L1_error) #endif - /* "constraint/constraints.py":711 + /* "constraint/constraints.py":795 * assert len(multipliers) == len(sum_vars) + 1, "Multipliers must match sum variables and +1 for target." * assert all(isinstance(m, (int, float)) for m in multipliers), "Multipliers must be numbers." * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." # <<<<<<<<<<<<<< @@ -18763,20 +20542,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_multipliers, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_multipliers, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 711, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_5, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) { - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_Last_multiplier_must_be_1_as_it, 0, 0); - __PYX_ERR(0, 711, __pyx_L1_error) + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Last_multiplier_must_be_1_as_it, 0, 0); + __PYX_ERR(0, 795, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 711, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 795, __pyx_L1_error) #endif - /* "constraint/constraints.py":708 + /* "constraint/constraints.py":792 * self._multipliers = multipliers * * if multipliers: # <<<<<<<<<<<<<< @@ -18785,10 +20564,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":694 + /* "constraint/constraints.py":778 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ @@ -18802,13 +20581,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_AddTraceback("constraint.constraints.VariableMaxSumConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_8__init___2generator6); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_8__init___2generator5); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":713 +/* "constraint/constraints.py":797 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -18859,50 +20638,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 713, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 797, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 713, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 797, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 713, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 797, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 713, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 797, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 713, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 797, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 713, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 797, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 713, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 797, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 713, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 797, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 713, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 797, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 713, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 797, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 713, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 797, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 713, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 797, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 713, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 797, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -18912,7 +20691,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 713, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 797, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18923,9 +20702,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 713, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 713, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 713, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 797, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 797, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 797, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -18944,9 +20723,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":721 +/* "constraint/constraints.py":805 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -18955,29 +20734,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ */ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_10_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 721, __pyx_L1_error) + __PYX_ERR(0, 805, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_2generator7, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint_preProc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_2generator6, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint_preProc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -18993,9 +20772,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -19004,8 +20783,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - size_t __pyx_t_9; + size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -19021,17 +20799,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ __pyx_L3_first_run:; if (unlikely(__pyx_sent_value != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); - __PYX_ERR(0, 721, __pyx_L1_error) + __PYX_ERR(0, 805, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 721, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 805, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -19039,17 +20817,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 721, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 805, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 721, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 805, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -19060,13 +20838,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 721, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 805, __pyx_L1_error) PyErr_Clear(); } break; @@ -19077,29 +20855,26 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 721, __pyx_L1_error) } - __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_v, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 721, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_var)) { __Pyx_RaiseClosureNameError("var"); __PYX_ERR(0, 805, __pyx_L1_error) } + __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_v, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __pyx_t_6 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_7 = __pyx_builtin_min; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 721, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 805, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 721, __pyx_L1_error) + __PYX_ERR(0, 805, __pyx_L1_error) } - __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_v); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 721, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = 1; + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_v); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_r = __pyx_t_4; @@ -19120,7 +20895,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 721, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 805, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19134,7 +20909,6 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -19150,7 +20924,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":713 +/* "constraint/constraints.py":797 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -19159,12 +20933,12 @@ static PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_ */ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *__pyx_cur_scope; PyObject *__pyx_v_multipliers = NULL; PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_others_min = NULL; PyObject *__pyx_v_value = NULL; - PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_2generator7 = 0; + PyObject *__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_2generator6 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -19177,20 +20951,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - Py_ssize_t __pyx_t_12; - PyObject *(*__pyx_t_13)(PyObject *); + Py_ssize_t __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); + PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_preProcess(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_preProcess(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 713, __pyx_L1_error) + __PYX_ERR(0, 797, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -19198,7 +20971,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_domains); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_domains); - /* "constraint/constraints.py":714 + /* "constraint/constraints.py":798 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -19206,9 +20979,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ * multipliers = self._multipliers */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 714, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -19225,54 +20998,54 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_self, __pyx_v_variables, __pyx_cur_scope->__pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":716 + /* "constraint/constraints.py":800 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * * multipliers = self._multipliers # <<<<<<<<<<<<<< * * if not multipliers: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":718 + /* "constraint/constraints.py":802 * multipliers = self._multipliers * * if not multipliers: # <<<<<<<<<<<<<< * for var in self.sum_vars: * domain = domains[var] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 718, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 802, __pyx_L1_error) __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "constraint/constraints.py":719 + /* "constraint/constraints.py":803 * * if not multipliers: * for var in self.sum_vars: # <<<<<<<<<<<<<< * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 719, __pyx_L1_error) + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 803, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -19281,17 +21054,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 719, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 803, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_8); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 719, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 803, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -19302,13 +21075,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 719, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 803, __pyx_L1_error) PyErr_Clear(); } break; @@ -19320,19 +21093,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":720 + /* "constraint/constraints.py":804 * if not multipliers: * for var in self.sum_vars: * domain = domains[var] # <<<<<<<<<<<<<< * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":721 + /* "constraint/constraints.py":805 * for var in self.sum_vars: * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) # <<<<<<<<<<<<<< @@ -19340,79 +21113,76 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ * if value + others_min > max(domains[self.target_var]): */ __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_sum); - __pyx_t_3 = __pyx_builtin_sum; - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 721, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_11}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_10}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_sum, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_others_min, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":722 + /* "constraint/constraints.py":806 * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: # <<<<<<<<<<<<<< * if value + others_min > max(domains[self.target_var]): * domain.remove(value) */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); - __pyx_t_12 = 0; - __pyx_t_13 = NULL; + __pyx_t_10 = __pyx_t_1; __Pyx_INCREF(__pyx_t_10); + __pyx_t_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 722, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 806, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 806, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_10))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 722, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 806, __pyx_L1_error) #endif - if (__pyx_t_12 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); - ++__pyx_t_12; + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_11; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 722, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 806, __pyx_L1_error) #endif - if (__pyx_t_12 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_11)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_11); #endif - ++__pyx_t_12; + ++__pyx_t_11; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_13(__pyx_t_3); + __pyx_t_1 = __pyx_t_12(__pyx_t_10); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 722, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 806, __pyx_L1_error) PyErr_Clear(); } break; @@ -19422,60 +21192,57 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":723 + /* "constraint/constraints.py":807 * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): # <<<<<<<<<<<<<< * domain.remove(value) * */ - __pyx_t_1 = PyNumber_Add(__pyx_v_value, __pyx_v_others_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_value, __pyx_v_others_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_10 = __pyx_builtin_max; - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_3 = NULL; + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_15}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_14}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_t_11, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 723, __pyx_L1_error) + __pyx_t_14 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 723, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 807, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":724 + /* "constraint/constraints.py":808 * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): * domain.remove(value) # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 */ - __pyx_t_11 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_11); + __pyx_t_2 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_value}; - __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value}; + __pyx_t_14 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "constraint/constraints.py":723 + /* "constraint/constraints.py":807 * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: * if value + others_min > max(domains[self.target_var]): # <<<<<<<<<<<<<< @@ -19484,7 +21251,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":722 + /* "constraint/constraints.py":806 * domain = domains[var] * others_min = sum(min(domains[v]) for v in self.sum_vars if v != var) * for value in domain[:]: # <<<<<<<<<<<<<< @@ -19492,9 +21259,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ * domain.remove(value) */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":719 + /* "constraint/constraints.py":803 * * if not multipliers: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -19504,7 +21271,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":718 + /* "constraint/constraints.py":802 * multipliers = self._multipliers * * if not multipliers: # <<<<<<<<<<<<<< @@ -19513,7 +21280,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":713 + /* "constraint/constraints.py":797 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -19530,9 +21297,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); - __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("constraint.constraints.VariableMaxSumConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -19540,14 +21306,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_others_min); __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_2generator7); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_24VariableMaxSumConstraint_10preProcess_2generator6); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":726 +/* "constraint/constraints.py":810 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -19598,53 +21364,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 726, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 810, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 726, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 810, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 726, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 810, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 726, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 810, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 726, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 810, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 726, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 810, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 726, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 810, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 726, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 810, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 726, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 810, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 726, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 810, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 726, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 810, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 726, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 810, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 726, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 810, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -19658,7 +21424,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 726, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 810, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19669,8 +21435,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 726, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 726, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 810, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 810, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -19702,44 +21468,43 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - size_t __pyx_t_6; - Py_ssize_t __pyx_t_7; - PyObject *(*__pyx_t_8)(PyObject *); + size_t __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); - PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":727 + /* "constraint/constraints.py":811 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * multipliers = self._multipliers # <<<<<<<<<<<<<< * * if self.target_var not in assignments: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":729 + /* "constraint/constraints.py":813 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< * return True # can't evaluate without target, defer to later * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 729, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":730 + /* "constraint/constraints.py":814 * * if self.target_var not in assignments: * return True # can't evaluate without target, defer to later # <<<<<<<<<<<<<< @@ -19751,7 +21516,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":729 + /* "constraint/constraints.py":813 * multipliers = self._multipliers * * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -19760,22 +21525,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":732 + /* "constraint/constraints.py":816 * return True # can't evaluate without target, defer to later * * target_value = assignments[self.target_var] # <<<<<<<<<<<<<< * sum_value = 0 * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_target_value = __pyx_t_3; __pyx_t_3 = 0; - /* "constraint/constraints.py":733 + /* "constraint/constraints.py":817 * * target_value = assignments[self.target_var] * sum_value = 0 # <<<<<<<<<<<<<< @@ -19785,17 +21550,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_sum_value = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":735 + /* "constraint/constraints.py":819 * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 819, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":736 + /* "constraint/constraints.py":820 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -19803,64 +21568,61 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ * sum_value += assignments[var] * multiplier */ __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_4 = __pyx_builtin_zip; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = 1; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 820, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_v_multipliers}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_4, __pyx_v_multipliers}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 736, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); - __pyx_t_7 = 0; - __pyx_t_8 = NULL; + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 820, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_8)) { + if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 736, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 820, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); - ++__pyx_t_7; + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 736, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 820, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); + __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); #endif - ++__pyx_t_7; + ++__pyx_t_6; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 736, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error) } else { - __pyx_t_3 = __pyx_t_8(__pyx_t_4); + __pyx_t_3 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 736, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 820, __pyx_L1_error) PyErr_Clear(); } break; @@ -19873,40 +21635,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 736, __pyx_L1_error) + __PYX_ERR(0, 820, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_5); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_1); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 820, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 820, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 736, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; + index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 736, __pyx_L1_error) + index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 820, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; @@ -19914,43 +21676,43 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 736, __pyx_L1_error) + __PYX_ERR(0, 820, __pyx_L1_error) __pyx_L8_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_multiplier, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":737 + /* "constraint/constraints.py":821 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< * sum_value += assignments[var] * multiplier * else: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 821, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":738 + /* "constraint/constraints.py":822 * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: * sum_value += assignments[var] * multiplier # <<<<<<<<<<<<<< * else: * sum_value += min(domains[var] * multiplier) # use min value if not assigned */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 822, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":737 + /* "constraint/constraints.py":821 * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): * if var in assignments: # <<<<<<<<<<<<<< @@ -19960,7 +21722,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L9; } - /* "constraint/constraints.py":740 + /* "constraint/constraints.py":824 * sum_value += assignments[var] * multiplier * else: * sum_value += min(domains[var] * multiplier) # use min value if not assigned # <<<<<<<<<<<<<< @@ -19968,33 +21730,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ * for var in self.sum_vars: */ /*else*/ { - __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_5 = __pyx_builtin_min; - __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 740, __pyx_L1_error) + __pyx_t_8 = NULL; + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyNumber_Multiply(__pyx_t_1, __pyx_v_multiplier); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = PyNumber_Multiply(__pyx_t_9, __pyx_v_multiplier); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_6 = 1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_11}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_9); + __pyx_t_9 = 0; } __pyx_L9:; - /* "constraint/constraints.py":736 + /* "constraint/constraints.py":820 * * if multipliers: * for var, multiplier in zip(self.sum_vars, multipliers): # <<<<<<<<<<<<<< @@ -20004,7 +21763,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":735 + /* "constraint/constraints.py":819 * sum_value = 0 * * if multipliers: # <<<<<<<<<<<<<< @@ -20014,7 +21773,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L4; } - /* "constraint/constraints.py":742 + /* "constraint/constraints.py":826 * sum_value += min(domains[var] * multiplier) # use min value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -20022,52 +21781,52 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ * sum_value += assignments[var] */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sum_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); - __pyx_t_7 = 0; - __pyx_t_8 = NULL; + __pyx_t_9 = __pyx_t_4; __Pyx_INCREF(__pyx_t_9); + __pyx_t_6 = 0; + __pyx_t_7 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 742, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 826, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { - if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_5))) { + if (likely(!__pyx_t_7)) { + if (likely(PyList_CheckExact(__pyx_t_9))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 742, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 826, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_7); - ++__pyx_t_7; + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_6; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 742, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 826, __pyx_L1_error) #endif - if (__pyx_t_7 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_6); #endif - ++__pyx_t_7; + ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_8(__pyx_t_5); + __pyx_t_4 = __pyx_t_7(__pyx_t_9); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 742, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 826, __pyx_L1_error) PyErr_Clear(); } break; @@ -20077,32 +21836,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":743 + /* "constraint/constraints.py":827 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< * sum_value += assignments[var] * else: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 743, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 827, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":744 + /* "constraint/constraints.py":828 * for var in self.sum_vars: * if var in assignments: * sum_value += assignments[var] # <<<<<<<<<<<<<< * else: * sum_value += min(domains[var]) # use min value if not assigned */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":743 + /* "constraint/constraints.py":827 * else: * for var in self.sum_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -20112,7 +21871,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ goto __pyx_L13; } - /* "constraint/constraints.py":746 + /* "constraint/constraints.py":830 * sum_value += assignments[var] * else: * sum_value += min(domains[var]) # use min value if not assigned # <<<<<<<<<<<<<< @@ -20121,29 +21880,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ /*else*/ { __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_11 = __pyx_builtin_min; - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = 1; + __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 746, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_sum_value, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 830, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_11); - __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_8); + __pyx_t_8 = 0; } __pyx_L13:; - /* "constraint/constraints.py":742 + /* "constraint/constraints.py":826 * sum_value += min(domains[var] * multiplier) # use min value if not assigned * else: * for var in self.sum_vars: # <<<<<<<<<<<<<< @@ -20151,11 +21907,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ * sum_value += assignments[var] */ } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_L4:; - /* "constraint/constraints.py":748 + /* "constraint/constraints.py":832 * sum_value += min(domains[var]) # use min value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -20165,29 +21921,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __pyx_t_2 = PyFloat_Check(__pyx_v_sum_value); if (__pyx_t_2) { - /* "constraint/constraints.py":749 + /* "constraint/constraints.py":833 * * if isinstance(sum_value, float): * sum_value = round(sum_value, 10) # <<<<<<<<<<<<<< * * return sum_value <= target_value */ - __pyx_t_11 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_3 = __pyx_builtin_round; - __pyx_t_6 = 1; + __pyx_t_8 = NULL; + __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_v_sum_value, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_sum_value, __pyx_mstate_global->__pyx_int_10}; + __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 833, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); } - __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_sum_value, __pyx_t_9); + __pyx_t_9 = 0; - /* "constraint/constraints.py":748 + /* "constraint/constraints.py":832 * sum_value += min(domains[var]) # use min value if not assigned * * if isinstance(sum_value, float): # <<<<<<<<<<<<<< @@ -20196,7 +21949,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ */ } - /* "constraint/constraints.py":751 + /* "constraint/constraints.py":835 * sum_value = round(sum_value, 10) * * return sum_value <= target_value # <<<<<<<<<<<<<< @@ -20204,12 +21957,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_sum_value, __pyx_v_target_value, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error) - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_v_sum_value, __pyx_v_target_value, Py_LE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 835, __pyx_L1_error) + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; goto __pyx_L0; - /* "constraint/constraints.py":726 + /* "constraint/constraints.py":810 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -20222,9 +21975,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("constraint.constraints.VariableMaxSumConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -20238,10 +21990,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_24VariableMaxSumConstraint_ return __pyx_r; } -/* "constraint/constraints.py":765 +/* "constraint/constraints.py":854 * """ * - * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, exactprod: int | float): # <<<<<<<<<<<<<< * """Instantiate an ExactProdConstraint. * */ @@ -20287,39 +22039,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_exactprod,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 765, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 854, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 765, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 854, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 765, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 854, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 765, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 854, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 765, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 854, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 765, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 854, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 765, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 854, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_exactprod = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 765, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 854, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20343,24 +22095,37 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_exactprod) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":771 + /* "constraint/constraints.py":860 * exactprod: Value to be considered as the product * """ * self._exactprod = exactprod # <<<<<<<<<<<<<< + * self._variable_contains_lt1: list[bool] = list() + * +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactprod_2, __pyx_v_exactprod) < (0)) __PYX_ERR(0, 860, __pyx_L1_error) + + /* "constraint/constraints.py":861 + * """ + * self._exactprod = exactprod + * self._variable_contains_lt1: list[bool] = list() # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactprod_2, __pyx_v_exactprod) < 0) __PYX_ERR(0, 771, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 861, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1, __pyx_t_1) < (0)) __PYX_ERR(0, 861, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":765 + /* "constraint/constraints.py":854 * """ * - * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, exactprod: int | float): # <<<<<<<<<<<<<< * """Instantiate an ExactProdConstraint. * */ @@ -20369,6 +22134,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___ini __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("constraint.constraints.ExactProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -20377,8 +22143,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":773 - * self._exactprod = exactprod +/* "constraint/constraints.py":863 + * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -20428,50 +22194,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 773, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 863, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 773, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 863, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 773, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 863, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 773, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 863, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 773, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 863, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 773, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 863, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 773, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 863, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 773, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 863, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 773, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 863, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 773, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 863, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 773, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 863, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 773, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 863, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 773, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 863, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -20481,7 +22247,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 773, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 863, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20492,9 +22258,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 773, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 773, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 773, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 863, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 863, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 863, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -20513,9 +22279,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10preProcess_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10preProcess_2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":780 +/* "constraint/constraints.py":870 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -20524,18 +22290,18 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre */ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_10preProcess_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_10_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 780, __pyx_L1_error) + __PYX_ERR(0, 870, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -20543,7 +22309,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_10pre __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_19ExactProdConstraint_10preProcess_2generator8, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint_preProcess_l, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 780, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_19ExactProdConstraint_10preProcess_2generator7, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint_preProcess_l, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -20559,9 +22325,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_10pre return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10preProcess_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10preProcess_2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -20580,16 +22346,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 780, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 780, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 870, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 870, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -20597,17 +22363,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 780, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 870, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 780, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 870, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -20618,13 +22384,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 780, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 780, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 870, __pyx_L1_error) PyErr_Clear(); } break; @@ -20635,8 +22401,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_value, __pyx_mstate_global->__pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 780, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 780, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_value, __pyx_mstate_global->__pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -20675,8 +22441,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10pre return __pyx_r; } -/* "constraint/constraints.py":773 - * self._exactprod = exactprod +/* "constraint/constraints.py":863 + * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -20690,7 +22456,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP PyObject *__pyx_v_exactprod = NULL; PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_value = NULL; - PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10preProcess_2generator8 = 0; + PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10preProcess_2generator7 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -20712,7 +22478,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":774 + /* "constraint/constraints.py":864 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -20720,9 +22486,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP * # check if there are any values less than 1 in the associated variables */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -20739,27 +22505,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":777 + /* "constraint/constraints.py":867 * * # check if there are any values less than 1 in the associated variables * self._variable_contains_lt1: list[bool] = list() # <<<<<<<<<<<<<< * variable_with_lt1 = None * for variable in variables: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1, __pyx_t_1) < 0) __PYX_ERR(0, 777, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1, __pyx_t_1) < (0)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":778 + /* "constraint/constraints.py":868 * # check if there are any values less than 1 in the associated variables * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None # <<<<<<<<<<<<<< @@ -20769,7 +22535,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_INCREF(Py_None); __pyx_v_variable_with_lt1 = Py_None; - /* "constraint/constraints.py":779 + /* "constraint/constraints.py":869 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -20781,9 +22547,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 779, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 869, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -20791,17 +22557,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 779, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 869, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 779, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 869, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20812,13 +22578,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 779, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 869, __pyx_L1_error) PyErr_Clear(); } break; @@ -20828,37 +22594,37 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":780 + /* "constraint/constraints.py":870 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 780, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_pf_10constraint_11constraints_19ExactProdConstraint_10preProcess_genexpr(NULL, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_11constraints_19ExactProdConstraint_10preProcess_genexpr(NULL, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 780, __pyx_L1_error) + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":781 + /* "constraint/constraints.py":871 * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) * self._variable_contains_lt1.append(contains_lt1) # <<<<<<<<<<<<<< * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_v_contains_lt1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_v_contains_lt1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":779 + /* "constraint/constraints.py":869 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -20868,7 +22634,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":782 + /* "constraint/constraints.py":872 * contains_lt1 = any(value < 1 for value in domains[variable]) * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< @@ -20876,18 +22642,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP * if variable_with_lt1 is not None: */ __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_2 = __pyx_builtin_zip; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_variables, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_variables, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -20895,9 +22658,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 872, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -20906,17 +22669,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 782, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 872, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 782, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 872, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -20927,13 +22690,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 872, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 782, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 872, __pyx_L1_error) PyErr_Clear(); } break; @@ -20946,40 +22709,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 782, __pyx_L1_error) + __PYX_ERR(0, 872, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 782, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; + index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 782, __pyx_L1_error) + index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 872, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -20987,15 +22750,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 782, __pyx_L1_error) + __PYX_ERR(0, 872, __pyx_L1_error) __pyx_L9_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":783 + /* "constraint/constraints.py":873 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -21005,7 +22768,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __pyx_t_11 = (__pyx_v_contains_lt1 == Py_True); if (__pyx_t_11) { - /* "constraint/constraints.py":784 + /* "constraint/constraints.py":874 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -21015,7 +22778,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __pyx_t_11 = (__pyx_v_variable_with_lt1 != Py_None); if (__pyx_t_11) { - /* "constraint/constraints.py":786 + /* "constraint/constraints.py":876 * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune * return # <<<<<<<<<<<<<< @@ -21027,7 +22790,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/constraints.py":784 + /* "constraint/constraints.py":874 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -21036,7 +22799,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":787 + /* "constraint/constraints.py":877 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -21046,7 +22809,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_INCREF(__pyx_v_variable); __Pyx_DECREF_SET(__pyx_v_variable_with_lt1, __pyx_v_variable); - /* "constraint/constraints.py":783 + /* "constraint/constraints.py":873 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -21055,7 +22818,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":782 + /* "constraint/constraints.py":872 * contains_lt1 = any(value < 1 for value in domains[variable]) * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< @@ -21065,19 +22828,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":790 + /* "constraint/constraints.py":880 * * # prune the associated variables of values > exactprod * exactprod = self._exactprod # <<<<<<<<<<<<<< * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactprod_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactprod_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_exactprod = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/constraints.py":791 + /* "constraint/constraints.py":881 * # prune the associated variables of values > exactprod * exactprod = self._exactprod * for variable in variables: # <<<<<<<<<<<<<< @@ -21089,9 +22852,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 791, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 881, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -21099,17 +22862,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 791, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 881, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 791, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 881, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -21120,13 +22883,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 791, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 881, __pyx_L1_error) PyErr_Clear(); } break; @@ -21136,7 +22899,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":792 + /* "constraint/constraints.py":882 * exactprod = self._exactprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -21149,14 +22912,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __pyx_t_11 = __pyx_t_12; goto __pyx_L16_bool_binop_done; } - __pyx_t_1 = PyObject_RichCompare(__pyx_v_variable_with_lt1, __pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 792, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_variable_with_lt1, __pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __pyx_t_12; __pyx_L16_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":793 + /* "constraint/constraints.py":883 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< @@ -21165,7 +22928,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ goto __pyx_L13_continue; - /* "constraint/constraints.py":792 + /* "constraint/constraints.py":882 * exactprod = self._exactprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -21174,71 +22937,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP */ } - /* "constraint/constraints.py":794 + /* "constraint/constraints.py":884 * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value > exactprod: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":795 + /* "constraint/constraints.py":885 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if value > exactprod: * domain.remove(value) */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 795, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 885, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 795, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 885, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_13); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_13; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 795, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 885, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_4); + __pyx_t_1 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 795, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 885, __pyx_L1_error) PyErr_Clear(); } break; @@ -21248,38 +23011,38 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":796 + /* "constraint/constraints.py":886 * domain = domains[variable] * for value in domain[:]: * if value > exactprod: # <<<<<<<<<<<<<< * domain.remove(value) * elif value == 0 and exactprod != 0: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_v_exactprod, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 796, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_v_exactprod, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":797 + /* "constraint/constraints.py":887 * for value in domain[:]: * if value > exactprod: * domain.remove(value) # <<<<<<<<<<<<<< * elif value == 0 and exactprod != 0: * domain.remove(value) */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_value}; + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":796 + /* "constraint/constraints.py":886 * domain = domains[variable] * for value in domain[:]: * if value > exactprod: # <<<<<<<<<<<<<< @@ -21289,44 +23052,44 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP goto __pyx_L20; } - /* "constraint/constraints.py":798 + /* "constraint/constraints.py":888 * if value > exactprod: * domain.remove(value) * elif value == 0 and exactprod != 0: # <<<<<<<<<<<<<< * domain.remove(value) * */ - __pyx_t_12 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 798, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 888, __pyx_L1_error) if (__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L21_bool_binop_done; } - __pyx_t_12 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_exactprod, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 798, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_exactprod, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 888, __pyx_L1_error) __pyx_t_11 = __pyx_t_12; __pyx_L21_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":799 + /* "constraint/constraints.py":889 * domain.remove(value) * elif value == 0 and exactprod != 0: * domain.remove(value) # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 799, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_value}; + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":798 + /* "constraint/constraints.py":888 * if value > exactprod: * domain.remove(value) * elif value == 0 and exactprod != 0: # <<<<<<<<<<<<<< @@ -21336,7 +23099,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __pyx_L20:; - /* "constraint/constraints.py":795 + /* "constraint/constraints.py":885 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -21344,9 +23107,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP * domain.remove(value) */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":791 + /* "constraint/constraints.py":881 * # prune the associated variables of values > exactprod * exactprod = self._exactprod * for variable in variables: # <<<<<<<<<<<<<< @@ -21357,8 +23120,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":773 - * self._exactprod = exactprod + /* "constraint/constraints.py":863 + * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -21383,13 +23146,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_2preP __Pyx_XDECREF(__pyx_v_exactprod); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10preProcess_2generator8); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_19ExactProdConstraint_10preProcess_2generator7); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":801 +/* "constraint/constraints.py":891 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -21440,98 +23203,267 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 801, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 891, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 801, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 891, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 801, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 891, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 801, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 891, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 801, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 891, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 801, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 891, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 801, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 891, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 801, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 891, __pyx_L3_error) } + } + } else { + switch (__pyx_nargs) { + case 5: + values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 891, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 4: + values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 891, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 891, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 891, __pyx_L3_error) + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 891, __pyx_L3_error) + break; + default: goto __pyx_L5_argtuple_error; + } + if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); + } + __pyx_v_self = values[0]; + __pyx_v_variables = values[1]; + __pyx_v_domains = ((PyObject*)values[2]); + __pyx_v_assignments = ((PyObject*)values[3]); + __pyx_v_forwardcheck = values[4]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 891, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __Pyx_AddTraceback("constraint.constraints.ExactProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 891, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_r = __pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + goto __pyx_L7_cleaned_up; + __pyx_L0:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __pyx_L7_cleaned_up:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__call___2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/constraints.py":899 + * if len(self._variable_contains_lt1) != len(variables): + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) # <<<<<<<<<<<<<< + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_8__call___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 899, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__call___2generator8, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint___call___loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.ExactProdConstraint.__call__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__call___2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 899, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 899, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 899, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 899, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_2; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 899, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); + #endif + ++__pyx_t_2; } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 899, __pyx_L1_error) } else { - switch (__pyx_nargs) { - case 5: - values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 801, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 4: - values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 801, __pyx_L3_error) - values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 801, __pyx_L3_error) - values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 801, __pyx_L3_error) - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 801, __pyx_L3_error) + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 899, __pyx_L1_error) + PyErr_Clear(); + } break; - default: goto __pyx_L5_argtuple_error; } - if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); } - __pyx_v_self = values[0]; - __pyx_v_variables = values[1]; - __pyx_v_domains = ((PyObject*)values[2]); - __pyx_v_assignments = ((PyObject*)values[3]); - __pyx_v_forwardcheck = values[4]; + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_value, __pyx_mstate_global->__pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 801, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; } - __Pyx_AddTraceback("constraint.constraints.ExactProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 801, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 801, __pyx_L1_error) - __pyx_r = __pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __pyx_r = NULL; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); } - goto __pyx_L7_cleaned_up; __pyx_L0:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __pyx_L7_cleaned_up:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* "constraint/constraints.py":891 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * exactprod = self._exactprod + * prod = 1 +*/ + static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck) { PyObject *__pyx_v_exactprod = NULL; PyObject *__pyx_v_prod = NULL; @@ -21541,40 +23473,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca PyObject *__pyx_v_contains_lt1 = NULL; PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_value = NULL; + PyObject *__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__call___2generator8 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - PyObject *(*__pyx_t_9)(PyObject *); - int __pyx_t_10; - int __pyx_t_11; - int __pyx_t_12; - Py_ssize_t __pyx_t_13; + int __pyx_t_9; + size_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; PyObject *(*__pyx_t_14)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":802 + /* "constraint/constraints.py":892 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * exactprod = self._exactprod # <<<<<<<<<<<<<< * prod = 1 * missing = False */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exactprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":803 + /* "constraint/constraints.py":893 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * exactprod = self._exactprod * prod = 1 # <<<<<<<<<<<<<< @@ -21584,93 +23517,204 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; - /* "constraint/constraints.py":804 + /* "constraint/constraints.py":894 * exactprod = self._exactprod * prod = 1 * missing = False # <<<<<<<<<<<<<< * missing_lt1 = [] - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * # find out which variables contain values less than 1 if not preprocessed */ __pyx_v_missing = 0; - /* "constraint/constraints.py":805 + /* "constraint/constraints.py":895 * prod = 1 * missing = False * missing_lt1 = [] # <<<<<<<<<<<<<< - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if variable in assignments: + * # find out which variables contain values less than 1 if not preprocessed + * if len(self._variable_contains_lt1) != len(variables): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":806 - * missing = False + /* "constraint/constraints.py":897 + * missing_lt1 = [] + * # find out which variables contain values less than 1 if not preprocessed + * if len(self._variable_contains_lt1) != len(variables): # <<<<<<<<<<<<<< + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 897, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_2 != __pyx_t_3); + if (__pyx_t_4) { + + /* "constraint/constraints.py":898 + * # find out which variables contain values less than 1 if not preprocessed + * if len(self._variable_contains_lt1) != len(variables): + * for variable in variables: # <<<<<<<<<<<<<< + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): +*/ + if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { + __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 898, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_3; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 898, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); + #else + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); + #endif + ++__pyx_t_3; + } + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 898, __pyx_L1_error) + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 898, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); + __pyx_t_6 = 0; + + /* "constraint/constraints.py":899 + * if len(self._variable_contains_lt1) != len(variables): + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) # <<<<<<<<<<<<<< + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: +*/ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __pyx_pf_10constraint_11constraints_19ExactProdConstraint_8__call___genexpr(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "constraint/constraints.py":898 + * # find out which variables contain values less than 1 if not preprocessed + * if len(self._variable_contains_lt1) != len(variables): + * for variable in variables: # <<<<<<<<<<<<<< + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":897 * missing_lt1 = [] + * # find out which variables contain values less than 1 if not preprocessed + * if len(self._variable_contains_lt1) != len(variables): # <<<<<<<<<<<<<< + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) +*/ + } + + /* "constraint/constraints.py":900 + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< * if variable in assignments: * prod *= assignments[variable] */ - __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_3 = __pyx_builtin_zip; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; + __pyx_t_7 = NULL; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 900, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_variables, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_variables, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); + __pyx_t_3 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 806, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 900, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 900, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 806, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 900, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_3; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 806, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 900, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_3)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_3); #endif - ++__pyx_t_6; + ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_3); + __pyx_t_1 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 806, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 900, __pyx_L1_error) PyErr_Clear(); } break; @@ -21683,91 +23727,91 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 806, __pyx_L1_error) + __PYX_ERR(0, 900, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_7); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 900, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 900, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 900, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 900, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 806, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 900, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); - index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 806, __pyx_L1_error) - __pyx_t_9 = NULL; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L6_unpacking_done; - __pyx_L5_unpacking_failed:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = NULL; + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); + index = 0; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + index = 1; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < (0)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L10_unpacking_done; + __pyx_L9_unpacking_failed:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 806, __pyx_L1_error) - __pyx_L6_unpacking_done:; + __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_L10_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":807 - * missing_lt1 = [] + /* "constraint/constraints.py":901 + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: # <<<<<<<<<<<<<< * prod *= assignments[variable] * else: */ - __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 807, __pyx_L1_error) - if (__pyx_t_10) { + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 901, __pyx_L1_error) + if (__pyx_t_4) { - /* "constraint/constraints.py":808 + /* "constraint/constraints.py":902 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: * prod *= assignments[variable] # <<<<<<<<<<<<<< * else: * missing = True */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 902, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":807 - * missing_lt1 = [] + /* "constraint/constraints.py":901 + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: # <<<<<<<<<<<<<< * prod *= assignments[variable] * else: */ - goto __pyx_L7; + goto __pyx_L11; } - /* "constraint/constraints.py":810 + /* "constraint/constraints.py":904 * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< @@ -21777,26 +23821,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca /*else*/ { __pyx_v_missing = 1; - /* "constraint/constraints.py":811 + /* "constraint/constraints.py":905 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< * missing_lt1.append(variable) * if isinstance(prod, float): */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 811, __pyx_L1_error) - if (__pyx_t_10) { + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 905, __pyx_L1_error) + if (__pyx_t_4) { - /* "constraint/constraints.py":812 + /* "constraint/constraints.py":906 * missing = True * if contains_lt1: * missing_lt1.append(variable) # <<<<<<<<<<<<<< * if isinstance(prod, float): * prod = round(prod, 10) */ - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 812, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 906, __pyx_L1_error) - /* "constraint/constraints.py":811 + /* "constraint/constraints.py":905 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< @@ -21805,51 +23849,48 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } } - __pyx_L7:; + __pyx_L11:; - /* "constraint/constraints.py":806 - * missing = False - * missing_lt1 = [] + /* "constraint/constraints.py":900 + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< * if variable in assignments: * prod *= assignments[variable] */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":813 + /* "constraint/constraints.py":907 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): */ - __pyx_t_10 = PyFloat_Check(__pyx_v_prod); - if (__pyx_t_10) { + __pyx_t_4 = PyFloat_Check(__pyx_v_prod); + if (__pyx_t_4) { - /* "constraint/constraints.py":814 + /* "constraint/constraints.py":908 * missing_lt1.append(variable) * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False */ - __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; - __pyx_t_5 = 1; + __pyx_t_8 = NULL; + __pyx_t_10 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_prod, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 814, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_prod, __pyx_mstate_global->__pyx_int_10}; + __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 908, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); } - __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_6); + __pyx_t_6 = 0; - /* "constraint/constraints.py":813 + /* "constraint/constraints.py":907 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -21858,42 +23899,42 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":815 + /* "constraint/constraints.py":909 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): # <<<<<<<<<<<<<< * return False * if forwardcheck: */ - __pyx_t_12 = (!__pyx_v_missing); - if (!__pyx_t_12) { - goto __pyx_L13_next_or; + __pyx_t_13 = (!__pyx_v_missing); + if (!__pyx_t_13) { + goto __pyx_L17_next_or; } else { } - __pyx_t_3 = PyObject_RichCompare(__pyx_v_prod, __pyx_v_exactprod, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 815, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 815, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!__pyx_t_12) { + __pyx_t_6 = PyObject_RichCompare(__pyx_v_prod, __pyx_v_exactprod, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 909, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 909, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!__pyx_t_13) { } else { - __pyx_t_10 = __pyx_t_12; - goto __pyx_L12_bool_binop_done; + __pyx_t_4 = __pyx_t_13; + goto __pyx_L16_bool_binop_done; } - __pyx_L13_next_or:; - __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 815, __pyx_L1_error) - __pyx_t_12 = (__pyx_t_6 == 0); - if (__pyx_t_12) { + __pyx_L17_next_or:; + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 909, __pyx_L1_error) + __pyx_t_13 = (__pyx_t_3 == 0); + if (__pyx_t_13) { } else { - __pyx_t_10 = __pyx_t_12; - goto __pyx_L12_bool_binop_done; + __pyx_t_4 = __pyx_t_13; + goto __pyx_L16_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(__pyx_v_prod, __pyx_v_exactprod, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 815, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 815, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_10 = __pyx_t_12; - __pyx_L12_bool_binop_done:; - if (__pyx_t_10) { + __pyx_t_6 = PyObject_RichCompare(__pyx_v_prod, __pyx_v_exactprod, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 909, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 909, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __pyx_t_13; + __pyx_L16_bool_binop_done:; + if (__pyx_t_4) { - /* "constraint/constraints.py":816 + /* "constraint/constraints.py":910 * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False # <<<<<<<<<<<<<< @@ -21905,7 +23946,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":815 + /* "constraint/constraints.py":909 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): # <<<<<<<<<<<<<< @@ -21914,17 +23955,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":817 + /* "constraint/constraints.py":911 * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 817, __pyx_L1_error) - if (__pyx_t_10) { + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 911, __pyx_L1_error) + if (__pyx_t_4) { - /* "constraint/constraints.py":818 + /* "constraint/constraints.py":912 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -21932,191 +23973,191 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca * domain = domains[variable] */ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_3 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_3); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + __pyx_t_6 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_6); + __pyx_t_3 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 912, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_3; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 912, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_3)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_3); #endif - ++__pyx_t_6; + ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 912, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { + __pyx_t_8 = __pyx_t_5(__pyx_t_6); + if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 818, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 912, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":819 + /* "constraint/constraints.py":913 * if forwardcheck: * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: */ - __pyx_t_12 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 819, __pyx_L1_error) - if (__pyx_t_12) { + __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 913, __pyx_L1_error) + if (__pyx_t_13) { } else { - __pyx_t_10 = __pyx_t_12; - goto __pyx_L20_bool_binop_done; + __pyx_t_4 = __pyx_t_13; + goto __pyx_L24_bool_binop_done; } - __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 819, __pyx_L1_error) - if (!__pyx_t_12) { + __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 913, __pyx_L1_error) + if (!__pyx_t_13) { } else { - __pyx_t_10 = __pyx_t_12; - goto __pyx_L20_bool_binop_done; + __pyx_t_4 = __pyx_t_13; + goto __pyx_L24_bool_binop_done; } - __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 819, __pyx_L1_error) - __pyx_t_12 = (__pyx_t_13 == 1); - __pyx_t_10 = __pyx_t_12; - __pyx_L20_bool_binop_done:; - if (__pyx_t_10) { + __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_t_13 = (__pyx_t_2 == 1); + __pyx_t_4 = __pyx_t_13; + __pyx_L24_bool_binop_done:; + if (__pyx_t_4) { - /* "constraint/constraints.py":820 + /* "constraint/constraints.py":914 * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if prod * value > exactprod: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":821 + /* "constraint/constraints.py":915 * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if prod * value > exactprod: * domain.hideValue(value) */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); - __pyx_t_13 = 0; + __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 915, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { + __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 821, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 915, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 915, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 821, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 915, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); - ++__pyx_t_13; + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_2; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 821, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 915, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif - ++__pyx_t_13; + ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 915, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { + __pyx_t_8 = __pyx_t_14(__pyx_t_1); + if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 821, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 915, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":822 + /* "constraint/constraints.py":916 * domain = domains[variable] * for value in domain[:]: * if prod * value > exactprod: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_exactprod, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_10) { + __pyx_t_8 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_v_exactprod, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 916, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 916, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_4) { - /* "constraint/constraints.py":823 + /* "constraint/constraints.py":917 * for value in domain[:]: * if prod * value > exactprod: * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False */ - __pyx_t_1 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; + __pyx_t_8 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_10 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_value}; + __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":822 + /* "constraint/constraints.py":916 * domain = domains[variable] * for value in domain[:]: * if prod * value > exactprod: # <<<<<<<<<<<<<< @@ -22125,7 +24166,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":821 + /* "constraint/constraints.py":915 * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -22133,20 +24174,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca * domain.hideValue(value) */ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":824 + /* "constraint/constraints.py":918 * if prod * value > exactprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 824, __pyx_L1_error) - __pyx_t_12 = (!__pyx_t_10); - if (__pyx_t_12) { + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 918, __pyx_L1_error) + __pyx_t_13 = (!__pyx_t_4); + if (__pyx_t_13) { - /* "constraint/constraints.py":825 + /* "constraint/constraints.py":919 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -22156,10 +24197,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/constraints.py":824 + /* "constraint/constraints.py":918 * if prod * value > exactprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -22168,7 +24209,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":819 + /* "constraint/constraints.py":913 * if forwardcheck: * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< @@ -22177,7 +24218,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":818 + /* "constraint/constraints.py":912 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -22185,9 +24226,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca * domain = domains[variable] */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":817 + /* "constraint/constraints.py":911 * if (not missing and prod != exactprod) or (len(missing_lt1) == 0 and prod > exactprod): * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -22196,7 +24237,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca */ } - /* "constraint/constraints.py":826 + /* "constraint/constraints.py":920 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -22208,7 +24249,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":801 + /* "constraint/constraints.py":891 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -22219,10 +24260,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("constraint.constraints.ExactProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -22233,12 +24274,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19ExactProdConstraint_4__ca __Pyx_XDECREF(__pyx_v_contains_lt1); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_19ExactProdConstraint_8__call___2generator8); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":839 +/* "constraint/constraints.py":939 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< @@ -22288,38 +24330,38 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_target_var,&__pyx_mstate_global->__pyx_n_u_product_vars,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 839, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 939, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 839, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 939, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 839, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 939, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 839, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 939, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 839, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 939, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 839, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 939, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 839, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 939, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 839, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 939, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 839, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 939, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -22327,7 +24369,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 839, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 939, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22338,7 +24380,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 839, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 939, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_27VariableExactProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_target_var, __pyx_v_product_vars); /* function exit code */ @@ -22366,25 +24408,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":846 + /* "constraint/constraints.py":946 * product_vars (sequence of Variables): The variables to calculate the product of. * """ * self.target_var = target_var # <<<<<<<<<<<<<< * self.product_vars = product_vars * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < 0) __PYX_ERR(0, 846, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < (0)) __PYX_ERR(0, 946, __pyx_L1_error) - /* "constraint/constraints.py":847 + /* "constraint/constraints.py":947 * """ * self.target_var = target_var * self.product_vars = product_vars # <<<<<<<<<<<<<< * * def _get_product_bounds(self, domain_dict, exclude_var=None): */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_v_product_vars) < 0) __PYX_ERR(0, 847, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_v_product_vars) < (0)) __PYX_ERR(0, 947, __pyx_L1_error) - /* "constraint/constraints.py":839 + /* "constraint/constraints.py":939 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< @@ -22404,7 +24446,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":849 +/* "constraint/constraints.py":949 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -22454,41 +24496,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domain_dict,&__pyx_mstate_global->__pyx_n_u_exclude_var,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 849, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 949, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 849, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 949, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 849, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 949, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 849, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 949, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_get_product_bounds", 0) < 0) __PYX_ERR(0, 849, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_get_product_bounds", 0) < (0)) __PYX_ERR(0, 949, __pyx_L3_error) if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 849, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 949, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 849, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 949, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 849, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 949, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 849, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 949, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -22500,7 +24542,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 849, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 949, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22528,11 +24570,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai PyObject *__pyx_v_all_bounds = NULL; PyObject *__pyx_v_candidates = NULL; PyObject *__pyx_v_products = NULL; - PyObject *__pyx_8genexpr9__pyx_v_b = NULL; - PyObject *__pyx_9genexpr10__pyx_v_b = NULL; - PyObject *__pyx_9genexpr11__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr11__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr12__pyx_v_p = NULL; + PyObject *__pyx_9genexpr19__pyx_v_b = NULL; + PyObject *__pyx_9genexpr20__pyx_v_b = NULL; + PyObject *__pyx_9genexpr21__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr21__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr22__pyx_v_p = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -22542,10 +24584,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - size_t __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; + size_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; @@ -22555,35 +24597,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":851 + /* "constraint/constraints.py":951 * def _get_product_bounds(self, domain_dict, exclude_var=None): * """Return min and max product of domains of product_vars (excluding `exclude_var` if given).""" * bounds = [] # <<<<<<<<<<<<<< * for var in self.product_vars: * if var == exclude_var: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":852 + /* "constraint/constraints.py":952 * """Return min and max product of domains of product_vars (excluding `exclude_var` if given).""" * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< * if var == exclude_var: * continue */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 952, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -22592,17 +24634,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 852, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 952, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 852, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 952, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -22613,13 +24655,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 852, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 952, __pyx_L1_error) PyErr_Clear(); } break; @@ -22629,19 +24671,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":853 + /* "constraint/constraints.py":953 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< * continue * dom = domain_dict[var] */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_var, __pyx_v_exclude_var, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 853, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_var, __pyx_v_exclude_var, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":854 + /* "constraint/constraints.py":954 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -22650,7 +24692,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ goto __pyx_L3_continue; - /* "constraint/constraints.py":853 + /* "constraint/constraints.py":953 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -22659,30 +24701,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":855 + /* "constraint/constraints.py":955 * if var == exclude_var: * continue * dom = domain_dict[var] # <<<<<<<<<<<<<< * if not dom: * continue */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":856 + /* "constraint/constraints.py":956 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< * continue * bounds.append((min(dom), max(dom))) */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dom); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dom); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 956, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "constraint/constraints.py":857 + /* "constraint/constraints.py":957 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -22691,7 +24733,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ goto __pyx_L3_continue; - /* "constraint/constraints.py":856 + /* "constraint/constraints.py":956 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -22700,7 +24742,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":858 + /* "constraint/constraints.py":958 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -22708,41 +24750,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * all_bounds = [b for b in bounds] */ __pyx_t_7 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_8 = __pyx_builtin_min; - __pyx_t_9 = 1; + __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_dom}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_7 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_10 = __pyx_builtin_max; - __pyx_t_9 = 1; + __pyx_t_9 = NULL; + __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_dom}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_dom}; + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 958, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 958, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 858, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 858, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 958, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 958, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_8 = 0; - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 858, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 958, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":852 + /* "constraint/constraints.py":952 * """Return min and max product of domains of product_vars (excluding `exclude_var` if given).""" * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -22753,7 +24789,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":860 + /* "constraint/constraints.py":960 * bounds.append((min(dom), max(dom))) * * all_bounds = [b for b in bounds] # <<<<<<<<<<<<<< @@ -22761,50 +24797,54 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * return 1, 1 */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L10_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_10); + __pyx_t_9 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_9); __pyx_t_3 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 860, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 960, __pyx_L10_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_3); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 860, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_b, __pyx_t_8); - __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_8genexpr9__pyx_v_b))) __PYX_ERR(0, 860, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 960, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_b, __pyx_t_7); + __pyx_t_7 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr19__pyx_v_b))) __PYX_ERR(0, 960, __pyx_L10_error) } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_b); __pyx_8genexpr9__pyx_v_b = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_b); __pyx_9genexpr19__pyx_v_b = 0; goto __pyx_L14_exit_scope; __pyx_L10_error:; - __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_b); __pyx_8genexpr9__pyx_v_b = 0; + __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_b); __pyx_9genexpr19__pyx_v_b = 0; goto __pyx_L1_error; __pyx_L14_exit_scope:; } /* exit inner scope */ __pyx_v_all_bounds = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":861 + /* "constraint/constraints.py":961 * * all_bounds = [b for b in bounds] * if not all_bounds: # <<<<<<<<<<<<<< * return 1, 1 * */ - __pyx_t_6 = (__Pyx_PyList_GET_SIZE(__pyx_v_all_bounds) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 861, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_all_bounds); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 961, __pyx_L1_error) + __pyx_t_6 = (__pyx_temp != 0); + } + __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { - /* "constraint/constraints.py":862 + /* "constraint/constraints.py":962 * all_bounds = [b for b in bounds] * if not all_bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -22816,7 +24856,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":861 + /* "constraint/constraints.py":961 * * all_bounds = [b for b in bounds] * if not all_bounds: # <<<<<<<<<<<<<< @@ -22825,7 +24865,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":865 + /* "constraint/constraints.py":965 * * # Get all combinations of min/max to find global min/max product * candidates = [b for b in product(*[(lo, hi) for lo, hi in all_bounds])] # <<<<<<<<<<<<<< @@ -22833,34 +24873,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * return min(products), max(products) */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L18_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 865, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 965, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_9); { /* enter inner scope */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 865, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 965, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __pyx_v_all_bounds; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 865, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 965, __pyx_L23_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_11 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 865, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_7); - if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { - PyObject* sequence = __pyx_t_7; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 965, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_11); + if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) { + PyObject* sequence = __pyx_t_11; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 865, __pyx_L23_error) + __PYX_ERR(0, 965, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -22869,31 +24909,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_13); } else { - __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 865, __pyx_L23_error) + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 965, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 865, __pyx_L23_error) + __pyx_t_13 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 965, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_13); } #else - __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 865, __pyx_L23_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 965, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 865, __pyx_L23_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 965, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); #endif - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 865, __pyx_L23_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 965, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); index = 0; __pyx_t_12 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_12)) goto __pyx_L26_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L26_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 865, __pyx_L23_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 965, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -22901,107 +24941,107 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 865, __pyx_L23_error) + __PYX_ERR(0, 965, __pyx_L23_error) __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_lo, __pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_lo, __pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_hi, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 865, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_9genexpr11__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr11__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr11__pyx_v_lo) != (0)) __PYX_ERR(0, 865, __pyx_L23_error); - __Pyx_INCREF(__pyx_9genexpr11__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr11__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr11__pyx_v_hi) != (0)) __PYX_ERR(0, 865, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 865, __pyx_L23_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 965, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_9genexpr21__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr21__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_9genexpr21__pyx_v_lo) != (0)) __PYX_ERR(0, 965, __pyx_L23_error); + __Pyx_INCREF(__pyx_9genexpr21__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr21__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_9genexpr21__pyx_v_hi) != (0)) __PYX_ERR(0, 965, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 965, __pyx_L23_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_hi); __pyx_9genexpr11__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_lo); __pyx_9genexpr11__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_hi); __pyx_9genexpr21__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_lo); __pyx_9genexpr21__pyx_v_lo = 0; goto __pyx_L29_exit_scope; __pyx_L23_error:; - __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_hi); __pyx_9genexpr11__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_lo); __pyx_9genexpr11__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_hi); __pyx_9genexpr21__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_lo); __pyx_9genexpr21__pyx_v_lo = 0; goto __pyx_L18_error; __pyx_L29_exit_scope:; } /* exit inner scope */ - __pyx_t_1 = PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L18_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 865, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 965, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { - __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L18_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 865, __pyx_L18_error) + __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 965, __pyx_L18_error) } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 865, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 965, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 865, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 965, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 865, __pyx_L18_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 965, __pyx_L18_error) } else { - __pyx_t_8 = __pyx_t_4(__pyx_t_1); - if (unlikely(!__pyx_t_8)) { + __pyx_t_7 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 865, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 965, __pyx_L18_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_b, __pyx_t_8); - __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr10__pyx_v_b))) __PYX_ERR(0, 865, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_b, __pyx_t_7); + __pyx_t_7 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr20__pyx_v_b))) __PYX_ERR(0, 965, __pyx_L18_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_b); __pyx_9genexpr10__pyx_v_b = 0; + __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_b); __pyx_9genexpr20__pyx_v_b = 0; goto __pyx_L31_exit_scope; __pyx_L18_error:; - __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_b); __pyx_9genexpr10__pyx_v_b = 0; + __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_b); __pyx_9genexpr20__pyx_v_b = 0; goto __pyx_L1_error; __pyx_L31_exit_scope:; } /* exit inner scope */ __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":866 + /* "constraint/constraints.py":966 * # Get all combinations of min/max to find global min/max product * candidates = [b for b in product(*[(lo, hi) for lo, hi in all_bounds])] * products = [self._safe_product(p) for p in candidates] # <<<<<<<<<<<<<< @@ -23009,7 +25049,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L34_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -23017,41 +25057,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 866, __pyx_L34_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 966, __pyx_L34_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 866, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr12__pyx_v_p, __pyx_t_8); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 966, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_p, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_9 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_9); __pyx_t_8 = 0; - __pyx_t_10 = __pyx_v_self; - __Pyx_INCREF(__pyx_t_10); - __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr12__pyx_v_p}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 866, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_9genexpr22__pyx_v_p}; + __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 966, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_7); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 866, __pyx_L34_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 966, __pyx_L34_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_p); __pyx_9genexpr12__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_p); __pyx_9genexpr22__pyx_v_p = 0; goto __pyx_L38_exit_scope; __pyx_L34_error:; - __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_p); __pyx_9genexpr12__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_p); __pyx_9genexpr22__pyx_v_p = 0; goto __pyx_L1_error; __pyx_L38_exit_scope:; } /* exit inner scope */ __pyx_v_products = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":867 + /* "constraint/constraints.py":967 * candidates = [b for b in product(*[(lo, hi) for lo, hi in all_bounds])] * products = [self._safe_product(p) for p in candidates] * return min(products), max(products) # <<<<<<<<<<<<<< @@ -23060,42 +25100,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_8 = __pyx_builtin_min; - __pyx_t_9 = 1; + __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 867, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_10 = __pyx_builtin_max; - __pyx_t_9 = 1; + __pyx_t_7 = NULL; + __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_products}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 967, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 867, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 867, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 967, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 967, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_8 = 0; - __pyx_r = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/constraints.py":849 + /* "constraint/constraints.py":949 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -23108,8 +25142,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); @@ -23122,17 +25156,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF(__pyx_v_all_bounds); __Pyx_XDECREF(__pyx_v_candidates); __Pyx_XDECREF(__pyx_v_products); - __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_b); - __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_b); - __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr12__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_b); + __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_b); + __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_p); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":869 +/* "constraint/constraints.py":969 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -23180,39 +25214,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_values,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 869, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 969, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 869, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 969, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 869, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 969, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_safe_product", 0) < 0) __PYX_ERR(0, 869, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_safe_product", 0) < (0)) __PYX_ERR(0, 969, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 869, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 969, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 869, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 969, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 869, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 969, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_values = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 869, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 969, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23247,7 +25281,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":870 + /* "constraint/constraints.py":970 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -23257,7 +25291,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; - /* "constraint/constraints.py":871 + /* "constraint/constraints.py":971 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -23269,9 +25303,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 971, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -23279,17 +25313,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 871, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 971, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 871, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 971, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -23300,13 +25334,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 971, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 871, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 971, __pyx_L1_error) PyErr_Clear(); } break; @@ -23316,19 +25350,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":872 + /* "constraint/constraints.py":972 * prod = 1 * for v in values: * prod *= v # <<<<<<<<<<<<<< * return prod * */ - __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":871 + /* "constraint/constraints.py":971 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -23338,7 +25372,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":873 + /* "constraint/constraints.py":973 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -23350,7 +25384,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":869 + /* "constraint/constraints.py":969 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -23372,7 +25406,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":875 +/* "constraint/constraints.py":975 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -23423,50 +25457,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 875, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 975, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 875, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 975, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 875, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 975, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 875, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 975, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 875, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 975, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 875, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 975, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 875, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 975, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 875, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 975, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 875, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 975, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 875, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 975, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 875, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 975, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 875, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 975, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 875, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 975, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -23476,7 +25510,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 875, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 975, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23487,9 +25521,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 875, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 875, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 875, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 975, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 975, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 975, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_6preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -23534,15 +25568,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai PyObject *(*__pyx_t_9)(PyObject *); Py_ssize_t __pyx_t_10; PyObject *(*__pyx_t_11)(PyObject *); - PyObject *__pyx_t_12 = NULL; + int __pyx_t_12; int __pyx_t_13; - int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":876 + /* "constraint/constraints.py":976 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -23550,9 +25583,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * target_domain = domains[self.target_var] */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -23569,30 +25602,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":878 + /* "constraint/constraints.py":978 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * * target_domain = domains[self.target_var] # <<<<<<<<<<<<<< * target_min = min(target_domain) * target_max = max(target_domain) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 878, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_target_domain = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":879 + /* "constraint/constraints.py":979 * * target_domain = domains[self.target_var] * target_min = min(target_domain) # <<<<<<<<<<<<<< @@ -23600,59 +25633,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * for var in self.product_vars: */ __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_2 = __pyx_builtin_min; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_target_domain}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_target_min = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":880 + /* "constraint/constraints.py":980 * target_domain = domains[self.target_var] * target_min = min(target_domain) * target_max = max(target_domain) # <<<<<<<<<<<<<< * for var in self.product_vars: * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) */ - __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_1 = __pyx_builtin_max; + __pyx_t_1 = NULL; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_target_domain}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 880, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_target_domain}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_target_max = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":881 + /* "constraint/constraints.py":981 * target_min = min(target_domain) * target_max = max(target_domain) * for var in self.product_vars: # <<<<<<<<<<<<<< * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) * domain = domains[var] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 981, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -23661,17 +25688,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 881, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 981, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 881, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 981, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -23682,13 +25709,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 881, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 981, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 881, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 981, __pyx_L1_error) PyErr_Clear(); } break; @@ -23698,7 +25725,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":882 + /* "constraint/constraints.py":982 * target_max = max(target_domain) * for var in self.product_vars: * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< @@ -23710,13 +25737,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_t_5 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_v_domains}; - __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_exclude_var, __pyx_v_var, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 882, __pyx_L1_error) - __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_exclude_var, __pyx_v_var, __pyx_t_3, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 982, __pyx_L1_error) + __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -23725,7 +25752,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 882, __pyx_L1_error) + __PYX_ERR(0, 982, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -23734,23 +25761,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); @@ -23758,7 +25785,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 882, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < (0)) __PYX_ERR(0, 982, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -23766,7 +25793,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 882, __pyx_L1_error) + __PYX_ERR(0, 982, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_other_min, __pyx_t_3); @@ -23774,35 +25801,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_other_max, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":883 + /* "constraint/constraints.py":983 * for var in self.product_vars: * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) * domain = domains[var] # <<<<<<<<<<<<<< * for value in domain[:]: * candidates = [value * other_min, value * other_max] */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":884 + /* "constraint/constraints.py":984 * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< * candidates = [value * other_min, value * other_max] * minval, maxval = min(candidates), max(candidates) */ - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 884, __pyx_L1_error) + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 984, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -23811,17 +25838,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 884, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 984, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_10); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_10; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 884, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 984, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } @@ -23832,13 +25859,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 984, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 884, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 984, __pyx_L1_error) PyErr_Clear(); } break; @@ -23848,29 +25875,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":885 + /* "constraint/constraints.py":985 * domain = domains[var] * for value in domain[:]: * candidates = [value * other_min, value * other_max] # <<<<<<<<<<<<<< * minval, maxval = min(candidates), max(candidates) * if maxval < target_min or minval > target_max: */ - __pyx_t_4 = PyNumber_Multiply(__pyx_v_value, __pyx_v_other_min); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_v_value, __pyx_v_other_min); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_v_other_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_v_other_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 885, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 885, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 985, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 885, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 985, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_candidates, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; - /* "constraint/constraints.py":886 + /* "constraint/constraints.py":986 * for value in domain[:]: * candidates = [value * other_min, value * other_max] * minval, maxval = min(candidates), max(candidates) # <<<<<<<<<<<<<< @@ -23878,57 +25905,51 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * domain.remove(value) */ __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_4 = __pyx_builtin_min; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_candidates}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 886, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_12 = __pyx_builtin_max; + __pyx_t_4 = NULL; __pyx_t_5 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_candidates}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 886, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_candidates}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 986, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_minval, __pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_maxval, __pyx_t_4); - __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_maxval, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":887 + /* "constraint/constraints.py":987 * candidates = [value * other_min, value * other_max] * minval, maxval = min(candidates), max(candidates) * if maxval < target_min or minval > target_max: # <<<<<<<<<<<<<< * domain.remove(value) * */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_maxval, __pyx_v_target_min, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_14) { + __pyx_t_3 = PyObject_RichCompare(__pyx_v_maxval, __pyx_v_target_min, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 987, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!__pyx_t_13) { } else { - __pyx_t_13 = __pyx_t_14; + __pyx_t_12 = __pyx_t_13; goto __pyx_L10_bool_binop_done; } - __pyx_t_4 = PyObject_RichCompare(__pyx_v_minval, __pyx_v_target_max, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error) - __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_14 < 0))) __PYX_ERR(0, 887, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_13 = __pyx_t_14; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_minval, __pyx_v_target_max, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 987, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_12 = __pyx_t_13; __pyx_L10_bool_binop_done:; - if (__pyx_t_13) { + if (__pyx_t_12) { - /* "constraint/constraints.py":888 + /* "constraint/constraints.py":988 * minval, maxval = min(candidates), max(candidates) * if maxval < target_min or minval > target_max: * domain.remove(value) # <<<<<<<<<<<<<< @@ -23940,14 +25961,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 988, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":887 + /* "constraint/constraints.py":987 * candidates = [value * other_min, value * other_max] * minval, maxval = min(candidates), max(candidates) * if maxval < target_min or minval > target_max: # <<<<<<<<<<<<<< @@ -23956,7 +25977,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":884 + /* "constraint/constraints.py":984 * other_min, other_max = self._get_product_bounds(domains, exclude_var=var) * domain = domains[var] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -23966,7 +25987,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":881 + /* "constraint/constraints.py":981 * target_min = min(target_domain) * target_max = max(target_domain) * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -23976,7 +25997,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":875 + /* "constraint/constraints.py":975 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -23993,7 +26014,6 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("constraint.constraints.VariableExactProdConstraint.preProcess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -24013,7 +26033,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai return __pyx_r; } -/* "constraint/constraints.py":890 +/* "constraint/constraints.py":990 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -24041,7 +26061,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED PyObject *__pyx_v_variables = 0; PyObject *__pyx_v_domains = 0; PyObject *__pyx_v_assignments = 0; - PyObject *__pyx_v_forwardcheck = 0; + CYTHON_UNUSED PyObject *__pyx_v_forwardcheck = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -24064,53 +26084,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 890, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 990, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 890, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 990, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 890, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 990, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 890, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 990, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 890, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 990, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 890, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 990, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 890, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 990, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 890, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 990, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 890, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 990, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 890, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 990, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 890, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 990, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 890, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 990, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 890, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 990, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -24124,7 +26144,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 890, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 990, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24135,8 +26155,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 890, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 890, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 990, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 990, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -24157,7 +26177,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":913 +/* "constraint/constraints.py":1013 * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned_vars] * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] * possible_min = min(assigned_product * c for c in candidates) # <<<<<<<<<<<<<< @@ -24177,7 +26197,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 913, __pyx_L1_error) + __PYX_ERR(0, 1013, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -24188,7 +26208,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator9, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint___ca, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator9, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint___ca, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -24226,29 +26246,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai __pyx_L3_first_run:; if (unlikely(__pyx_sent_value != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); - __PYX_ERR(0, 913, __pyx_L1_error) + __PYX_ERR(0, 1013, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 913, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1013, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 913, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1013, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_assigned_product)) { __Pyx_RaiseClosureNameError("assigned_product"); __PYX_ERR(0, 913, __pyx_L1_error) } - __pyx_t_3 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_assigned_product, __pyx_cur_scope->__pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_assigned_product)) { __Pyx_RaiseClosureNameError("assigned_product"); __PYX_ERR(0, 1013, __pyx_L1_error) } + __pyx_t_3 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_assigned_product, __pyx_cur_scope->__pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -24266,7 +26286,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 913, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1013, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -24293,7 +26313,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai } static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":914 +/* "constraint/constraints.py":1014 * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] * possible_min = min(assigned_product * c for c in candidates) * possible_max = max(assigned_product * c for c in candidates) # <<<<<<<<<<<<<< @@ -24313,7 +26333,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 914, __pyx_L1_error) + __PYX_ERR(0, 1014, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -24324,7 +26344,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator10, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint___ca, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator10, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint___ca, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -24362,29 +26382,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai __pyx_L3_first_run:; if (unlikely(__pyx_sent_value != Py_None)) { if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); - __PYX_ERR(0, 914, __pyx_L1_error) + __PYX_ERR(0, 1014, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 914, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1014, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 914, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1014, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_assigned_product)) { __Pyx_RaiseClosureNameError("assigned_product"); __PYX_ERR(0, 914, __pyx_L1_error) } - __pyx_t_3 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_assigned_product, __pyx_cur_scope->__pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_assigned_product)) { __Pyx_RaiseClosureNameError("assigned_product"); __PYX_ERR(0, 1014, __pyx_L1_error) } + __pyx_t_3 = PyNumber_Multiply(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_assigned_product, __pyx_cur_scope->__pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -24402,7 +26422,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 914, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1014, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -24427,139 +26447,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___8generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "constraint/constraints.py":928 - * for value in domain[:]: - * candidates = [assigned_product * value * p for p in other_products] - * if all(c != target_value for c in candidates): # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: -*/ - -static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___6genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_15_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 928, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *) __pyx_self; - __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); - __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); - __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; - __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___8generator11, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint___ca, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 928, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("constraint.constraints.VariableExactProdConstraint.__call__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___8generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("genexpr", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 928, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 928, __pyx_L1_error) } - __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 928, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); - ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_c, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value)) { __Pyx_RaiseClosureNameError("target_value"); __PYX_ERR(0, 928, __pyx_L1_error) } - __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_c, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 928, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = (!__pyx_t_4); - if (__pyx_t_5) { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - } - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - } - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - if (__Pyx_PyErr_Occurred()) { - __Pyx_Generator_Replace_StopIteration(0); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "constraint/constraints.py":890 +/* "constraint/constraints.py":990 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -24567,32 +26456,21 @@ static PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstrai * return True */ -static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck) { +static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck) { struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *__pyx_cur_scope; + PyObject *__pyx_v_target_value = NULL; PyObject *__pyx_v_unassigned_vars = NULL; PyObject *__pyx_v_var = NULL; PyObject *__pyx_v_domain_bounds = NULL; PyObject *__pyx_v_candidates = NULL; PyObject *__pyx_v_possible_min = NULL; PyObject *__pyx_v_possible_max = NULL; - PyObject *__pyx_v_others = NULL; - PyObject *__pyx_v_others_bounds = NULL; - PyObject *__pyx_v_other_products = NULL; - PyObject *__pyx_v_domain = NULL; - PyObject *__pyx_v_value = NULL; - PyObject *__pyx_9genexpr13__pyx_v_v = NULL; - PyObject *__pyx_9genexpr14__pyx_v_p = NULL; - PyObject *__pyx_9genexpr15__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr15__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr23__pyx_v_v = NULL; + PyObject *__pyx_9genexpr24__pyx_v_p = NULL; + PyObject *__pyx_9genexpr25__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr25__pyx_v_hi = NULL; PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator9 = 0; PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator10 = 0; - PyObject *__pyx_9genexpr18__pyx_v_v = NULL; - PyObject *__pyx_9genexpr19__pyx_v_v = NULL; - PyObject *__pyx_9genexpr20__pyx_v_p = NULL; - PyObject *__pyx_9genexpr21__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr21__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr22__pyx_v_p = NULL; - PyObject *__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___8generator11 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -24610,9 +26488,6 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *(*__pyx_t_15)(PyObject *); - Py_ssize_t __pyx_t_16; - PyObject *__pyx_t_17 = NULL; - Py_ssize_t __pyx_t_18; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -24621,25 +26496,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 890, __pyx_L1_error) + __PYX_ERR(0, 990, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":891 + /* "constraint/constraints.py":991 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< * return True * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":892 + /* "constraint/constraints.py":992 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: * return True # <<<<<<<<<<<<<< @@ -24651,7 +26526,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":891 + /* "constraint/constraints.py":991 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -24660,23 +26535,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":894 + /* "constraint/constraints.py":994 * return True * * target_value = assignments[self.target_var] # <<<<<<<<<<<<<< * assigned_product = 1 * unassigned_vars = [] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 894, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_target_value = __pyx_t_3; + __pyx_v_target_value = __pyx_t_3; __pyx_t_3 = 0; - /* "constraint/constraints.py":895 + /* "constraint/constraints.py":995 * * target_value = assignments[self.target_var] * assigned_product = 1 # <<<<<<<<<<<<<< @@ -24687,35 +26561,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1); __pyx_cur_scope->__pyx_v_assigned_product = __pyx_mstate_global->__pyx_int_1; - /* "constraint/constraints.py":896 + /* "constraint/constraints.py":996 * target_value = assignments[self.target_var] * assigned_product = 1 * unassigned_vars = [] # <<<<<<<<<<<<<< * * for var in self.product_vars: */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_unassigned_vars = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":898 + /* "constraint/constraints.py":998 * unassigned_vars = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< * if var in assignments: * assigned_product *= assignments[var] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 998, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -24724,17 +26598,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 898, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 998, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 898, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 998, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -24745,13 +26619,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 998, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 898, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 998, __pyx_L1_error) PyErr_Clear(); } break; @@ -24761,26 +26635,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":899 + /* "constraint/constraints.py":999 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< * assigned_product *= assignments[var] * else: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 899, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 999, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":900 + /* "constraint/constraints.py":1000 * for var in self.product_vars: * if var in assignments: * assigned_product *= assignments[var] # <<<<<<<<<<<<<< * else: * unassigned_vars.append(var) */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_cur_scope->__pyx_v_assigned_product, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 900, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_cur_scope->__pyx_v_assigned_product, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_assigned_product); @@ -24788,7 +26662,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":899 + /* "constraint/constraints.py":999 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -24798,7 +26672,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai goto __pyx_L6; } - /* "constraint/constraints.py":902 + /* "constraint/constraints.py":1002 * assigned_product *= assignments[var] * else: * unassigned_vars.append(var) # <<<<<<<<<<<<<< @@ -24806,11 +26680,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * if isinstance(assigned_product, float): */ /*else*/ { - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_unassigned_vars, __pyx_v_var); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 902, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_unassigned_vars, __pyx_v_var); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1002, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":898 + /* "constraint/constraints.py":998 * unassigned_vars = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -24820,7 +26694,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":904 + /* "constraint/constraints.py":1004 * unassigned_vars.append(var) * * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< @@ -24833,7 +26707,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":905 + /* "constraint/constraints.py":1005 * * if isinstance(assigned_product, float): * assigned_product = round(assigned_product, 10) # <<<<<<<<<<<<<< @@ -24841,15 +26715,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * if not unassigned_vars: */ __pyx_t_6 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_3 = __pyx_builtin_round; __pyx_t_8 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_assigned_product, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_assigned_product); @@ -24857,7 +26728,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":904 + /* "constraint/constraints.py":1004 * unassigned_vars.append(var) * * if isinstance(assigned_product, float): # <<<<<<<<<<<<<< @@ -24866,19 +26737,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":907 + /* "constraint/constraints.py":1007 * assigned_product = round(assigned_product, 10) * * if not unassigned_vars: # <<<<<<<<<<<<<< * return assigned_product == target_value * */ - __pyx_t_2 = (__Pyx_PyList_GET_SIZE(__pyx_v_unassigned_vars) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 907, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_unassigned_vars); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1007, __pyx_L1_error) + __pyx_t_2 = (__pyx_temp != 0); + } + __pyx_t_9 = (!__pyx_t_2); if (__pyx_t_9) { - /* "constraint/constraints.py":908 + /* "constraint/constraints.py":1008 * * if not unassigned_vars: * return assigned_product == target_value # <<<<<<<<<<<<<< @@ -24886,12 +26761,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * # Partial assignment check feasibility */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_assigned_product, __pyx_cur_scope->__pyx_v_target_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_assigned_product, __pyx_v_target_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":907 + /* "constraint/constraints.py":1007 * assigned_product = round(assigned_product, 10) * * if not unassigned_vars: # <<<<<<<<<<<<<< @@ -24900,7 +26775,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":911 + /* "constraint/constraints.py":1011 * * # Partial assignment check feasibility * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned_vars] # <<<<<<<<<<<<<< @@ -24908,77 +26783,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * possible_min = min(assigned_product * c for c in candidates) */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L12_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_v_unassigned_vars; __Pyx_INCREF(__pyx_t_3); + __pyx_t_6 = __pyx_v_unassigned_vars; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 911, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1011, __pyx_L12_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 911, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_v, __pyx_t_6); - __pyx_t_6 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_v, __pyx_t_3); + __pyx_t_3 = 0; __pyx_t_10 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_11 = __pyx_builtin_min; - __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr13__pyx_v_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 911, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr23__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1011, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_12}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 911, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_6); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_12 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_10 = __pyx_builtin_max; - __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr13__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 911, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = NULL; + __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr23__pyx_v_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1011, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_12); __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 911, __pyx_L12_error) + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_12}; + __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1011, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 911, __pyx_L12_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 911, __pyx_L12_error); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1011, __pyx_L12_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1011, __pyx_L12_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 911, __pyx_L12_error); - __pyx_t_6 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1011, __pyx_L12_error); + __pyx_t_3 = 0; __pyx_t_11 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 911, __pyx_L12_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1011, __pyx_L12_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_v); __pyx_9genexpr13__pyx_v_v = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_v); __pyx_9genexpr23__pyx_v_v = 0; goto __pyx_L16_exit_scope; __pyx_L12_error:; - __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_v); __pyx_9genexpr13__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_v); __pyx_9genexpr23__pyx_v_v = 0; goto __pyx_L1_error; __pyx_L16_exit_scope:; } /* exit inner scope */ __pyx_v_domain_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":912 + /* "constraint/constraints.py":1012 * # Partial assignment check feasibility * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned_vars] * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] # <<<<<<<<<<<<<< @@ -24986,67 +26855,67 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * possible_max = max(assigned_product * c for c in candidates) */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L19_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L19_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1012, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_6); { /* enter inner scope */ - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 912, __pyx_L24_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1012, __pyx_L24_error) + __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = __pyx_v_domain_bounds; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 912, __pyx_L24_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1012, __pyx_L24_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_11, __pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_11, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 912, __pyx_L24_error) - __Pyx_GOTREF(__pyx_t_6); - if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { - PyObject* sequence = __pyx_t_6; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1012, __pyx_L24_error) + __Pyx_GOTREF(__pyx_t_3); + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 912, __pyx_L24_error) + __PYX_ERR(0, 1012, __pyx_L24_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_10); + __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_13); - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_12); } else { - __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 912, __pyx_L24_error) + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1012, __pyx_L24_error) + __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1012, __pyx_L24_error) __Pyx_XGOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 912, __pyx_L24_error) - __Pyx_XGOTREF(__pyx_t_12); } #else - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 912, __pyx_L24_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1012, __pyx_L24_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1012, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 912, __pyx_L24_error) - __Pyx_GOTREF(__pyx_t_12); #endif - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 912, __pyx_L24_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1012, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); - index = 0; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L27_unpacking_failed; + index = 0; __pyx_t_10 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_10)) goto __pyx_L27_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L27_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); - index = 1; __pyx_t_12 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_12)) goto __pyx_L27_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 912, __pyx_L24_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1012, __pyx_L24_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L28_unpacking_done; @@ -25054,118 +26923,118 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 912, __pyx_L24_error) + __PYX_ERR(0, 1012, __pyx_L24_error) __pyx_L28_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_lo, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_lo, __pyx_t_10); + __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_hi, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 912, __pyx_L24_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_9genexpr15__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr15__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr15__pyx_v_lo) != (0)) __PYX_ERR(0, 912, __pyx_L24_error); - __Pyx_INCREF(__pyx_9genexpr15__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr15__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr15__pyx_v_hi) != (0)) __PYX_ERR(0, 912, __pyx_L24_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 912, __pyx_L24_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1012, __pyx_L24_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_9genexpr25__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr25__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_9genexpr25__pyx_v_lo) != (0)) __PYX_ERR(0, 1012, __pyx_L24_error); + __Pyx_INCREF(__pyx_9genexpr25__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr25__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr25__pyx_v_hi) != (0)) __PYX_ERR(0, 1012, __pyx_L24_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1012, __pyx_L24_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_hi); __pyx_9genexpr15__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_lo); __pyx_9genexpr15__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_hi); __pyx_9genexpr25__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_lo); __pyx_9genexpr25__pyx_v_lo = 0; goto __pyx_L30_exit_scope; __pyx_L24_error:; - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_hi); __pyx_9genexpr15__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_lo); __pyx_9genexpr15__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_hi); __pyx_9genexpr25__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_lo); __pyx_9genexpr25__pyx_v_lo = 0; goto __pyx_L19_error; __pyx_L30_exit_scope:; } /* exit inner scope */ - __pyx_t_11 = PySequence_Tuple(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 912, __pyx_L19_error) + __pyx_t_11 = PySequence_Tuple(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1012, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 912, __pyx_L19_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1012, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) { - __pyx_t_11 = __pyx_t_10; __Pyx_INCREF(__pyx_t_11); + if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) { + __pyx_t_11 = __pyx_t_12; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 912, __pyx_L19_error) + __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1012, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L19_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1012, __pyx_L19_error) } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_11))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 912, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1012, __pyx_L19_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_11, __pyx_t_4); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_11, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 912, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1012, __pyx_L19_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4)); + __pyx_t_12 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4)); #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_4); + __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_4); #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 912, __pyx_L19_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1012, __pyx_L19_error) } else { - __pyx_t_10 = __pyx_t_5(__pyx_t_11); - if (unlikely(!__pyx_t_10)) { + __pyx_t_12 = __pyx_t_5(__pyx_t_11); + if (unlikely(!__pyx_t_12)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 912, __pyx_L19_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1012, __pyx_L19_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_p, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_3 = __pyx_v_self; - __Pyx_INCREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_p, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_6 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_9genexpr14__pyx_v_p}; - __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 912, __pyx_L19_error) - __Pyx_GOTREF(__pyx_t_10); + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr24__pyx_v_p}; + __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1012, __pyx_L19_error) + __Pyx_GOTREF(__pyx_t_12); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 912, __pyx_L19_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1012, __pyx_L19_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_p); __pyx_9genexpr14__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_p); __pyx_9genexpr24__pyx_v_p = 0; goto __pyx_L32_exit_scope; __pyx_L19_error:; - __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_p); __pyx_9genexpr14__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_p); __pyx_9genexpr24__pyx_v_p = 0; goto __pyx_L1_error; __pyx_L32_exit_scope:; } /* exit inner scope */ __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":913 + /* "constraint/constraints.py":1013 * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned_vars] * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] * possible_min = min(assigned_product * c for c in candidates) # <<<<<<<<<<<<<< @@ -25173,83 +27042,77 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai * */ __pyx_t_11 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_10 = __pyx_builtin_min; - __pyx_t_3 = __pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_candidates); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = __pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_candidates); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_12}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_possible_min = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":914 + /* "constraint/constraints.py":1014 * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] * possible_min = min(assigned_product * c for c in candidates) * possible_max = max(assigned_product * c for c in candidates) # <<<<<<<<<<<<<< * * if target_value < possible_min or target_value > possible_max: */ - __pyx_t_10 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_3 = __pyx_builtin_max; - __pyx_t_11 = __pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___3genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_candidates); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_12 = NULL; + __pyx_t_11 = __pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___3genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_candidates); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_11}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_11}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_possible_max = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":916 + /* "constraint/constraints.py":1016 * possible_max = max(assigned_product * c for c in candidates) * * if target_value < possible_min or target_value > possible_max: # <<<<<<<<<<<<<< * return False * */ - __pyx_t_1 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_target_value, __pyx_v_possible_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 916, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_target_value, __pyx_v_possible_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_2) { } else { __pyx_t_9 = __pyx_t_2; goto __pyx_L34_bool_binop_done; } - __pyx_t_1 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_target_value, __pyx_v_possible_max, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 916, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_target_value, __pyx_v_possible_max, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = __pyx_t_2; __pyx_L34_bool_binop_done:; if (__pyx_t_9) { - /* "constraint/constraints.py":917 + /* "constraint/constraints.py":1017 * * if target_value < possible_min or target_value > possible_max: * return False # <<<<<<<<<<<<<< * - * if forwardcheck: + * # the below forwardcheck is incorrect for mixes of negative and positive values */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":916 + /* "constraint/constraints.py":1016 * possible_max = max(assigned_product * c for c in candidates) * * if target_value < possible_min or target_value > possible_max: # <<<<<<<<<<<<<< @@ -25258,598 +27121,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai */ } - /* "constraint/constraints.py":919 - * return False - * - * if forwardcheck: # <<<<<<<<<<<<<< - * for var in unassigned_vars: - * others = [v for v in unassigned_vars if v != var] -*/ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 919, __pyx_L1_error) - if (__pyx_t_9) { - - /* "constraint/constraints.py":920 - * - * if forwardcheck: - * for var in unassigned_vars: # <<<<<<<<<<<<<< - * others = [v for v in unassigned_vars if v != var] - * others_bounds = [(min(domains[v]), max(domains[v])) for v in others] or [(1, 1)] -*/ - __pyx_t_1 = __pyx_v_unassigned_vars; __Pyx_INCREF(__pyx_t_1); - __pyx_t_4 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 920, __pyx_L1_error) - #endif - if (__pyx_t_4 >= __pyx_temp) break; - } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); - ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":921 - * if forwardcheck: - * for var in unassigned_vars: - * others = [v for v in unassigned_vars if v != var] # <<<<<<<<<<<<<< - * others_bounds = [(min(domains[v]), max(domains[v])) for v in others] or [(1, 1)] - * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in others_bounds])] -*/ - { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 921, __pyx_L41_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __pyx_v_unassigned_vars; __Pyx_INCREF(__pyx_t_11); - __pyx_t_16 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 921, __pyx_L41_error) - #endif - if (__pyx_t_16 >= __pyx_temp) break; - } - __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_11, __pyx_t_16); - ++__pyx_t_16; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 921, __pyx_L41_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_v, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_9genexpr18__pyx_v_v, __pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 921, __pyx_L41_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 921, __pyx_L41_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_9) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_9genexpr18__pyx_v_v))) __PYX_ERR(0, 921, __pyx_L41_error) - } - } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_v); __pyx_9genexpr18__pyx_v_v = 0; - goto __pyx_L46_exit_scope; - __pyx_L41_error:; - __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_v); __pyx_9genexpr18__pyx_v_v = 0; - goto __pyx_L1_error; - __pyx_L46_exit_scope:; - } /* exit inner scope */ - __Pyx_XDECREF_SET(__pyx_v_others, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":922 - * for var in unassigned_vars: - * others = [v for v in unassigned_vars if v != var] - * others_bounds = [(min(domains[v]), max(domains[v])) for v in others] or [(1, 1)] # <<<<<<<<<<<<<< - * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in others_bounds])] - * -*/ - { /* enter inner scope */ - __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 922, __pyx_L51_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __pyx_v_others; __Pyx_INCREF(__pyx_t_10); - __pyx_t_16 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 922, __pyx_L51_error) - #endif - if (__pyx_t_16 >= __pyx_temp) break; - } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_16); - ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 922, __pyx_L51_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_v, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_12 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_13 = __pyx_builtin_min; - __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr19__pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 922, __pyx_L51_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_8 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_14}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 922, __pyx_L51_error) - __Pyx_GOTREF(__pyx_t_6); - } - __pyx_t_14 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_12 = __pyx_builtin_max; - __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr19__pyx_v_v); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 922, __pyx_L51_error) - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_8 = 1; - { - PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_17}; - __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 922, __pyx_L51_error) - __Pyx_GOTREF(__pyx_t_13); - } - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 922, __pyx_L51_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 922, __pyx_L51_error); - __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 922, __pyx_L51_error); - __pyx_t_6 = 0; - __pyx_t_13 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 922, __pyx_L51_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_v); __pyx_9genexpr19__pyx_v_v = 0; - goto __pyx_L55_exit_scope; - __pyx_L51_error:; - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_v); __pyx_9genexpr19__pyx_v_v = 0; - goto __pyx_L1_error; - __pyx_L55_exit_scope:; - } /* exit inner scope */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 922, __pyx_L1_error) - if (!__pyx_t_9) { - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } else { - __Pyx_INCREF(__pyx_t_11); - __pyx_t_3 = __pyx_t_11; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - goto __pyx_L47_bool_binop_done; - } - __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[0]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); - if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_mstate_global->__pyx_tuple[0]) != (0)) __PYX_ERR(0, 922, __pyx_L1_error); - __Pyx_INCREF(__pyx_t_11); - __pyx_t_3 = __pyx_t_11; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_L47_bool_binop_done:; - __Pyx_XDECREF_SET(__pyx_v_others_bounds, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":923 - * others = [v for v in unassigned_vars if v != var] - * others_bounds = [(min(domains[v]), max(domains[v])) for v in others] or [(1, 1)] - * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in others_bounds])] # <<<<<<<<<<<<<< - * - * domain = domains[var] -*/ - { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L58_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 923, __pyx_L58_error) - __Pyx_GOTREF(__pyx_t_11); - { /* enter inner scope */ - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 923, __pyx_L63_error) - __Pyx_GOTREF(__pyx_t_10); - if (unlikely(__pyx_v_others_bounds == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 923, __pyx_L63_error) - } - __pyx_t_12 = __pyx_v_others_bounds; __Pyx_INCREF(__pyx_t_12); - __pyx_t_16 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 923, __pyx_L63_error) - #endif - if (__pyx_t_16 >= __pyx_temp) break; - } - __pyx_t_13 = __Pyx_PyList_GetItemRef(__pyx_t_12, __pyx_t_16); - ++__pyx_t_16; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 923, __pyx_L63_error) - __Pyx_GOTREF(__pyx_t_13); - if ((likely(PyTuple_CheckExact(__pyx_t_13))) || (PyList_CheckExact(__pyx_t_13))) { - PyObject* sequence = __pyx_t_13; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 923, __pyx_L63_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_6); - __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_17); - } else { - __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 923, __pyx_L63_error) - __Pyx_XGOTREF(__pyx_t_6); - __pyx_t_17 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 923, __pyx_L63_error) - __Pyx_XGOTREF(__pyx_t_17); - } - #else - __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 923, __pyx_L63_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_17 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 923, __pyx_L63_error) - __Pyx_GOTREF(__pyx_t_17); - #endif - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 923, __pyx_L63_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); - index = 0; __pyx_t_6 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_6)) goto __pyx_L66_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - index = 1; __pyx_t_17 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_17)) goto __pyx_L66_unpacking_failed; - __Pyx_GOTREF(__pyx_t_17); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 923, __pyx_L63_error) - __pyx_t_15 = NULL; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - goto __pyx_L67_unpacking_done; - __pyx_L66_unpacking_failed:; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_15 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 923, __pyx_L63_error) - __pyx_L67_unpacking_done:; - } - __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_lo, __pyx_t_6); - __pyx_t_6 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_hi, __pyx_t_17); - __pyx_t_17 = 0; - __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 923, __pyx_L63_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_INCREF(__pyx_9genexpr21__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr21__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_9genexpr21__pyx_v_lo) != (0)) __PYX_ERR(0, 923, __pyx_L63_error); - __Pyx_INCREF(__pyx_9genexpr21__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr21__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_9genexpr21__pyx_v_hi) != (0)) __PYX_ERR(0, 923, __pyx_L63_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 923, __pyx_L63_error) - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_hi); __pyx_9genexpr21__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_lo); __pyx_9genexpr21__pyx_v_lo = 0; - goto __pyx_L69_exit_scope; - __pyx_L63_error:; - __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_hi); __pyx_9genexpr21__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_lo); __pyx_9genexpr21__pyx_v_lo = 0; - goto __pyx_L58_error; - __pyx_L69_exit_scope:; - } /* exit inner scope */ - __pyx_t_12 = PySequence_Tuple(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 923, __pyx_L58_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 923, __pyx_L58_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) { - __pyx_t_12 = __pyx_t_10; __Pyx_INCREF(__pyx_t_12); - __pyx_t_16 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_16 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 923, __pyx_L58_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L58_error) - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_12))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 923, __pyx_L58_error) - #endif - if (__pyx_t_16 >= __pyx_temp) break; - } - __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_12, __pyx_t_16); - ++__pyx_t_16; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 923, __pyx_L58_error) - #endif - if (__pyx_t_16 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_16)); - #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_16); - #endif - ++__pyx_t_16; - } - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 923, __pyx_L58_error) - } else { - __pyx_t_10 = __pyx_t_5(__pyx_t_12); - if (unlikely(!__pyx_t_10)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 923, __pyx_L58_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_p, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_11 = __pyx_v_self; - __Pyx_INCREF(__pyx_t_11); - __pyx_t_8 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_9genexpr20__pyx_v_p}; - __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 923, __pyx_L58_error) - __Pyx_GOTREF(__pyx_t_10); - } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 923, __pyx_L58_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_p); __pyx_9genexpr20__pyx_v_p = 0; - goto __pyx_L71_exit_scope; - __pyx_L58_error:; - __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_p); __pyx_9genexpr20__pyx_v_p = 0; - goto __pyx_L1_error; - __pyx_L71_exit_scope:; - } /* exit inner scope */ - __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":925 - * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in others_bounds])] - * - * domain = domains[var] # <<<<<<<<<<<<<< - * for value in domain[:]: - * candidates = [assigned_product * value * p for p in other_products] -*/ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":926 - * - * domain = domains[var] - * for value in domain[:]: # <<<<<<<<<<<<<< - * candidates = [assigned_product * value * p for p in other_products] - * if all(c != target_value for c in candidates): -*/ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 926, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_12 = __pyx_t_3; __Pyx_INCREF(__pyx_t_12); - __pyx_t_16 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_16 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 926, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 926, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_12))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 926, __pyx_L1_error) - #endif - if (__pyx_t_16 >= __pyx_temp) break; - } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_12, __pyx_t_16); - ++__pyx_t_16; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_12); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 926, __pyx_L1_error) - #endif - if (__pyx_t_16 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_16)); - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_12, __pyx_t_16); - #endif - ++__pyx_t_16; - } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 926, __pyx_L1_error) - } else { - __pyx_t_3 = __pyx_t_5(__pyx_t_12); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 926, __pyx_L1_error) - PyErr_Clear(); - } - break; - } - } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":927 - * domain = domains[var] - * for value in domain[:]: - * candidates = [assigned_product * value * p for p in other_products] # <<<<<<<<<<<<<< - * if all(c != target_value for c in candidates): - * domain.hideValue(value) -*/ - { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 927, __pyx_L76_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_10); - __pyx_t_18 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 927, __pyx_L76_error) - #endif - if (__pyx_t_18 >= __pyx_temp) break; - } - __pyx_t_11 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_18); - ++__pyx_t_18; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 927, __pyx_L76_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_XDECREF_SET(__pyx_9genexpr22__pyx_v_p, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_11 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_assigned_product, __pyx_v_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 927, __pyx_L76_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_13 = PyNumber_Multiply(__pyx_t_11, __pyx_9genexpr22__pyx_v_p); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 927, __pyx_L76_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 927, __pyx_L76_error) - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_p); __pyx_9genexpr22__pyx_v_p = 0; - goto __pyx_L80_exit_scope; - __pyx_L76_error:; - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_p); __pyx_9genexpr22__pyx_v_p = 0; - goto __pyx_L1_error; - __pyx_L80_exit_scope:; - } /* exit inner scope */ - __Pyx_DECREF_SET(__pyx_v_candidates, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "constraint/constraints.py":928 - * for value in domain[:]: - * candidates = [assigned_product * value * p for p in other_products] - * if all(c != target_value for c in candidates): # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: -*/ - __pyx_t_3 = __pyx_pf_10constraint_11constraints_27VariableExactProdConstraint_8__call___6genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_candidates); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_Generator_GetInlinedResult(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 928, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 928, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__pyx_t_9) { - - /* "constraint/constraints.py":929 - * candidates = [assigned_product * value * p for p in other_products] - * if all(c != target_value for c in candidates): - * domain.hideValue(value) # <<<<<<<<<<<<<< - * if not domain: - * return False -*/ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_8 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; - __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 929, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - - /* "constraint/constraints.py":928 - * for value in domain[:]: - * candidates = [assigned_product * value * p for p in other_products] - * if all(c != target_value for c in candidates): # <<<<<<<<<<<<<< - * domain.hideValue(value) - * if not domain: -*/ - } - - /* "constraint/constraints.py":926 - * - * domain = domains[var] - * for value in domain[:]: # <<<<<<<<<<<<<< - * candidates = [assigned_product * value * p for p in other_products] - * if all(c != target_value for c in candidates): -*/ - } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "constraint/constraints.py":930 - * if all(c != target_value for c in candidates): - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * -*/ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 930, __pyx_L1_error) - __pyx_t_2 = (!__pyx_t_9); - if (__pyx_t_2) { - - /* "constraint/constraints.py":931 - * domain.hideValue(value) - * if not domain: - * return False # <<<<<<<<<<<<<< - * - * return True -*/ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L0; - - /* "constraint/constraints.py":930 - * if all(c != target_value for c in candidates): - * domain.hideValue(value) - * if not domain: # <<<<<<<<<<<<<< - * return False - * -*/ - } - - /* "constraint/constraints.py":920 - * - * if forwardcheck: - * for var in unassigned_vars: # <<<<<<<<<<<<<< - * others = [v for v in unassigned_vars if v != var] - * others_bounds = [(min(domains[v]), max(domains[v])) for v in others] or [(1, 1)] -*/ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "constraint/constraints.py":919 - * return False - * - * if forwardcheck: # <<<<<<<<<<<<<< - * for var in unassigned_vars: - * others = [v for v in unassigned_vars if v != var] -*/ - } - - /* "constraint/constraints.py":933 - * return False + /* "constraint/constraints.py":1034 + * # return False * * return True # <<<<<<<<<<<<<< * @@ -25860,7 +27133,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":890 + /* "constraint/constraints.py":990 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -25878,44 +27151,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_27VariableExactProdConstrai __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); - __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("constraint.constraints.VariableExactProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_target_value); __Pyx_XDECREF(__pyx_v_unassigned_vars); __Pyx_XDECREF(__pyx_v_var); __Pyx_XDECREF(__pyx_v_domain_bounds); __Pyx_XDECREF(__pyx_v_candidates); __Pyx_XDECREF(__pyx_v_possible_min); __Pyx_XDECREF(__pyx_v_possible_max); - __Pyx_XDECREF(__pyx_v_others); - __Pyx_XDECREF(__pyx_v_others_bounds); - __Pyx_XDECREF(__pyx_v_other_products); - __Pyx_XDECREF(__pyx_v_domain); - __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_hi); __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___2generator9); __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___5generator10); - __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr21__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr22__pyx_v_p); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_27VariableExactProdConstraint_8__call___8generator11); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":947 - * """ +/* "constraint/constraints.py":1053 + * """ # noqa: E501 * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, minprod: int | float): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * */ @@ -25961,39 +27222,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_minprod,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 947, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1053, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 947, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1053, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 947, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1053, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 947, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1053, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 947, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1053, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 947, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1053, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 947, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1053, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_minprod = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 947, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1053, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26022,19 +27283,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":953 + /* "constraint/constraints.py":1059 * minprod: Value to be considered as the maximum product * """ * self._minprod = minprod # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minprod_2, __pyx_v_minprod) < 0) __PYX_ERR(0, 953, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minprod_2, __pyx_v_minprod) < (0)) __PYX_ERR(0, 1059, __pyx_L1_error) - /* "constraint/constraints.py":947 - * """ + /* "constraint/constraints.py":1053 + * """ # noqa: E501 * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, minprod: int | float): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * */ @@ -26051,7 +27312,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":955 +/* "constraint/constraints.py":1061 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -26102,50 +27363,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 955, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1061, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 955, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1061, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 955, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1061, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 955, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1061, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 955, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1061, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 955, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1061, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 955, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 1061, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 955, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1061, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 955, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1061, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 955, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1061, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 955, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1061, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 955, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1061, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 955, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1061, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -26155,7 +27416,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 955, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1061, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26166,9 +27427,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 955, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 955, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 955, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1061, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1061, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1061, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_17MinProdConstraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -26211,7 +27472,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":956 + /* "constraint/constraints.py":1062 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -26219,9 +27480,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro * # prune the associated variables of values > minprod */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 956, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -26238,27 +27499,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":959 + /* "constraint/constraints.py":1065 * * # prune the associated variables of values > minprod * minprod = self._minprod # <<<<<<<<<<<<<< * for variable in variables: * domain = domains[variable] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":960 + /* "constraint/constraints.py":1066 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -26270,9 +27531,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 960, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1066, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -26280,17 +27541,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 960, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 960, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -26301,13 +27562,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 960, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1066, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 960, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1066, __pyx_L1_error) PyErr_Clear(); } break; @@ -26317,35 +27578,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":961 + /* "constraint/constraints.py":1067 * minprod = self._minprod * for variable in variables: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value == 0 and minprod > 0: */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 961, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":962 + /* "constraint/constraints.py":1068 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if value == 0 and minprod > 0: * domain.remove(value) */ - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1068, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -26354,17 +27615,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 962, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_8); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 962, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -26375,13 +27636,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1068, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_9(__pyx_t_2); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 962, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1068, __pyx_L1_error) PyErr_Clear(); } break; @@ -26391,27 +27652,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":963 + /* "constraint/constraints.py":1069 * domain = domains[variable] * for value in domain[:]: * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< * domain.remove(value) * */ - __pyx_t_11 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1069, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L8_bool_binop_done; } - __pyx_t_4 = PyObject_RichCompare(__pyx_v_minprod, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 963, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_minprod, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1069, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1069, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_10 = __pyx_t_11; __pyx_L8_bool_binop_done:; if (__pyx_t_10) { - /* "constraint/constraints.py":964 + /* "constraint/constraints.py":1070 * for value in domain[:]: * if value == 0 and minprod > 0: * domain.remove(value) # <<<<<<<<<<<<<< @@ -26423,14 +27684,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 964, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":963 + /* "constraint/constraints.py":1069 * domain = domains[variable] * for value in domain[:]: * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< @@ -26439,7 +27700,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro */ } - /* "constraint/constraints.py":962 + /* "constraint/constraints.py":1068 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -26449,7 +27710,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":960 + /* "constraint/constraints.py":1066 * # prune the associated variables of values > minprod * minprod = self._minprod * for variable in variables: # <<<<<<<<<<<<<< @@ -26459,7 +27720,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":955 + /* "constraint/constraints.py":1061 * self._minprod = minprod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -26487,7 +27748,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro return __pyx_r; } -/* "constraint/constraints.py":966 +/* "constraint/constraints.py":1072 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -26538,53 +27799,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 966, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1072, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 966, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1072, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 966, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1072, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 966, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1072, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 966, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1072, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 966, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1072, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 966, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 1072, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 966, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1072, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 966, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1072, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 966, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1072, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 966, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1072, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 966, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1072, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 966, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1072, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -26598,7 +27859,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 966, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1072, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26609,8 +27870,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 966, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 966, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1072, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1072, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -26648,7 +27909,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":968 + /* "constraint/constraints.py":1074 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * # check if each variable is in the assignments * for variable in variables: # <<<<<<<<<<<<<< @@ -26660,9 +27921,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 968, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -26670,17 +27931,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 968, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1074, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 968, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1074, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26691,13 +27952,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1074, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 968, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1074, __pyx_L1_error) PyErr_Clear(); } break; @@ -26707,17 +27968,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":969 + /* "constraint/constraints.py":1075 * # check if each variable is in the assignments * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * return True * */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 969, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1075, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":970 + /* "constraint/constraints.py":1076 * for variable in variables: * if variable not in assignments: * return True # <<<<<<<<<<<<<< @@ -26730,7 +27991,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":969 + /* "constraint/constraints.py":1075 * # check if each variable is in the assignments * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -26739,7 +28000,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":968 + /* "constraint/constraints.py":1074 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * # check if each variable is in the assignments * for variable in variables: # <<<<<<<<<<<<<< @@ -26749,19 +28010,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":973 + /* "constraint/constraints.py":1079 * * # with each variable assigned, sum the values * minprod = self._minprod # <<<<<<<<<<<<<< * prod = 1 * for variable in variables: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":974 + /* "constraint/constraints.py":1080 * # with each variable assigned, sum the values * minprod = self._minprod * prod = 1 # <<<<<<<<<<<<<< @@ -26771,7 +28032,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; - /* "constraint/constraints.py":975 + /* "constraint/constraints.py":1081 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -26783,9 +28044,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1081, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -26793,17 +28054,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 975, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 975, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1081, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -26814,13 +28075,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 975, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1081, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 975, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1081, __pyx_L1_error) PyErr_Clear(); } break; @@ -26830,22 +28091,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":976 + /* "constraint/constraints.py":1082 * prod = 1 * for variable in variables: * prod *= assignments[variable] # <<<<<<<<<<<<<< * if isinstance(prod, float): * prod = round(prod, 10) */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 976, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":975 + /* "constraint/constraints.py":1081 * minprod = self._minprod * prod = 1 * for variable in variables: # <<<<<<<<<<<<<< @@ -26855,7 +28116,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":977 + /* "constraint/constraints.py":1083 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -26865,7 +28126,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call __pyx_t_5 = PyFloat_Check(__pyx_v_prod); if (__pyx_t_5) { - /* "constraint/constraints.py":978 + /* "constraint/constraints.py":1084 * prod *= assignments[variable] * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< @@ -26873,21 +28134,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * */ __pyx_t_6 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_4 = __pyx_builtin_round; __pyx_t_7 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_prod, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":977 + /* "constraint/constraints.py":1083 * for variable in variables: * prod *= assignments[variable] * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -26896,7 +28154,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call */ } - /* "constraint/constraints.py":979 + /* "constraint/constraints.py":1085 * if isinstance(prod, float): * prod = round(prod, 10) * return prod >= minprod # <<<<<<<<<<<<<< @@ -26904,12 +28162,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_prod, __pyx_v_minprod, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_prod, __pyx_v_minprod, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1085, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":966 + /* "constraint/constraints.py":1072 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -26933,7 +28191,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call return __pyx_r; } -/* "constraint/constraints.py":993 +/* "constraint/constraints.py":1105 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -26982,38 +28240,38 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_target_var,&__pyx_mstate_global->__pyx_n_u_product_vars,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 993, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1105, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 993, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1105, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 993, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1105, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 993, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1105, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 993, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1105, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 993, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 1105, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 993, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1105, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 993, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1105, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 993, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1105, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -27021,7 +28279,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 993, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1105, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27032,7 +28290,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 993, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 1105, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_25VariableMinProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_target_var, __pyx_v_product_vars); /* function exit code */ @@ -27060,25 +28318,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":994 + /* "constraint/constraints.py":1106 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 * self.target_var = target_var # <<<<<<<<<<<<<< * self.product_vars = product_vars * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < 0) __PYX_ERR(0, 994, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < (0)) __PYX_ERR(0, 1106, __pyx_L1_error) - /* "constraint/constraints.py":995 + /* "constraint/constraints.py":1107 * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 * self.target_var = target_var * self.product_vars = product_vars # <<<<<<<<<<<<<< * * def _get_product_bounds(self, domain_dict, exclude_var=None): */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_v_product_vars) < 0) __PYX_ERR(0, 995, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_v_product_vars) < (0)) __PYX_ERR(0, 1107, __pyx_L1_error) - /* "constraint/constraints.py":993 + /* "constraint/constraints.py":1105 * """ * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -27098,7 +28356,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":997 +/* "constraint/constraints.py":1109 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -27147,41 +28405,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domain_dict,&__pyx_mstate_global->__pyx_n_u_exclude_var,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 997, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1109, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 997, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1109, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 997, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1109, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 997, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1109, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_get_product_bounds", 0) < 0) __PYX_ERR(0, 997, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_get_product_bounds", 0) < (0)) __PYX_ERR(0, 1109, __pyx_L3_error) if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 997, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 1109, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 997, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1109, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 997, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1109, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 997, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1109, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -27193,7 +28451,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 997, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1109, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27220,10 +28478,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint PyObject *__pyx_v_dom = NULL; PyObject *__pyx_v_candidates = NULL; PyObject *__pyx_v_products = NULL; - PyObject *__pyx_9genexpr24__pyx_v_p = NULL; - PyObject *__pyx_9genexpr25__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr25__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr26__pyx_v_p = NULL; + PyObject *__pyx_9genexpr28__pyx_v_p = NULL; + PyObject *__pyx_9genexpr29__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr29__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr30__pyx_v_p = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -27233,10 +28491,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - size_t __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; + size_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; @@ -27246,35 +28504,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":998 + /* "constraint/constraints.py":1110 * * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] # <<<<<<<<<<<<<< * for var in self.product_vars: * if var == exclude_var: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":999 + /* "constraint/constraints.py":1111 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< * if var == exclude_var: * continue */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1111, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -27283,17 +28541,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 999, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1111, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 999, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1111, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -27304,13 +28562,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 999, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1111, __pyx_L1_error) PyErr_Clear(); } break; @@ -27320,19 +28578,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1000 + /* "constraint/constraints.py":1112 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< * continue * dom = domain_dict[var] */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_var, __pyx_v_exclude_var, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1000, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_var, __pyx_v_exclude_var, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1001 + /* "constraint/constraints.py":1113 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -27341,7 +28599,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1000 + /* "constraint/constraints.py":1112 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -27350,30 +28608,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1002 + /* "constraint/constraints.py":1114 * if var == exclude_var: * continue * dom = domain_dict[var] # <<<<<<<<<<<<<< * if not dom: * continue */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1003 + /* "constraint/constraints.py":1115 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< * continue * bounds.append((min(dom), max(dom))) */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dom); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1003, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dom); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "constraint/constraints.py":1004 + /* "constraint/constraints.py":1116 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -27382,7 +28640,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1003 + /* "constraint/constraints.py":1115 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -27391,7 +28649,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1005 + /* "constraint/constraints.py":1117 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -27399,41 +28657,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * if not bounds: */ __pyx_t_7 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_8 = __pyx_builtin_min; - __pyx_t_9 = 1; + __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_dom}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_7 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_10 = __pyx_builtin_max; - __pyx_t_9 = 1; + __pyx_t_9 = NULL; + __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_dom}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1005, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_dom}; + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1005, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1005, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1005, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1117, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1117, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_8 = 0; - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1005, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":999 + /* "constraint/constraints.py":1111 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -27444,19 +28696,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1007 + /* "constraint/constraints.py":1119 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< * return 1, 1 * */ - __pyx_t_6 = (__Pyx_PyList_GET_SIZE(__pyx_v_bounds) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 1007, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_bounds); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_6 = (__pyx_temp != 0); + } + __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { - /* "constraint/constraints.py":1008 + /* "constraint/constraints.py":1120 * * if not bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -27468,7 +28724,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":1007 + /* "constraint/constraints.py":1119 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -27477,7 +28733,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1011 + /* "constraint/constraints.py":1123 * * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -27485,34 +28741,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * return min(products), max(products) */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L11_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1123, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1011, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1123, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_9); { /* enter inner scope */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1011, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1123, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1011, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1123, __pyx_L16_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_11 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1011, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_7); - if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { - PyObject* sequence = __pyx_t_7; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1123, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_11); + if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) { + PyObject* sequence = __pyx_t_11; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1011, __pyx_L16_error) + __PYX_ERR(0, 1123, __pyx_L16_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -27521,31 +28777,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_13); } else { - __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1011, __pyx_L16_error) + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1123, __pyx_L16_error) __Pyx_XGOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1011, __pyx_L16_error) + __pyx_t_13 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1123, __pyx_L16_error) __Pyx_XGOTREF(__pyx_t_13); } #else - __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1011, __pyx_L16_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1123, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1011, __pyx_L16_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1123, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_13); #endif - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1011, __pyx_L16_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1123, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); index = 0; __pyx_t_12 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_12)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1011, __pyx_L16_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1123, __pyx_L16_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L20_unpacking_done; @@ -27553,107 +28809,107 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1011, __pyx_L16_error) + __PYX_ERR(0, 1123, __pyx_L16_error) __pyx_L20_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_lo, __pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_lo, __pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_hi, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1011, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_9genexpr25__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr25__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr25__pyx_v_lo) != (0)) __PYX_ERR(0, 1011, __pyx_L16_error); - __Pyx_INCREF(__pyx_9genexpr25__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr25__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr25__pyx_v_hi) != (0)) __PYX_ERR(0, 1011, __pyx_L16_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1011, __pyx_L16_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1123, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_9genexpr29__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr29__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_9genexpr29__pyx_v_lo) != (0)) __PYX_ERR(0, 1123, __pyx_L16_error); + __Pyx_INCREF(__pyx_9genexpr29__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr29__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_9genexpr29__pyx_v_hi) != (0)) __PYX_ERR(0, 1123, __pyx_L16_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1123, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_hi); __pyx_9genexpr25__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_lo); __pyx_9genexpr25__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_hi); __pyx_9genexpr29__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_lo); __pyx_9genexpr29__pyx_v_lo = 0; goto __pyx_L22_exit_scope; __pyx_L16_error:; - __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_hi); __pyx_9genexpr25__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_lo); __pyx_9genexpr25__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_hi); __pyx_9genexpr29__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_lo); __pyx_9genexpr29__pyx_v_lo = 0; goto __pyx_L11_error; __pyx_L22_exit_scope:; } /* exit inner scope */ - __pyx_t_1 = PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L11_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1011, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1123, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { - __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L11_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1011, __pyx_L11_error) + __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1123, __pyx_L11_error) } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1011, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1123, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1011, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1123, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1011, __pyx_L11_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1123, __pyx_L11_error) } else { - __pyx_t_8 = __pyx_t_4(__pyx_t_1); - if (unlikely(!__pyx_t_8)) { + __pyx_t_7 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1011, __pyx_L11_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1123, __pyx_L11_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_p, __pyx_t_8); - __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr24__pyx_v_p))) __PYX_ERR(0, 1011, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr28__pyx_v_p, __pyx_t_7); + __pyx_t_7 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_p))) __PYX_ERR(0, 1123, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_p); __pyx_9genexpr24__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_p); __pyx_9genexpr28__pyx_v_p = 0; goto __pyx_L24_exit_scope; __pyx_L11_error:; - __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_p); __pyx_9genexpr24__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_p); __pyx_9genexpr28__pyx_v_p = 0; goto __pyx_L1_error; __pyx_L24_exit_scope:; } /* exit inner scope */ __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1012 + /* "constraint/constraints.py":1124 * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] * products = [self._safe_product(p) for p in candidates] # <<<<<<<<<<<<<< @@ -27661,7 +28917,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1012, __pyx_L27_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1124, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -27669,41 +28925,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1012, __pyx_L27_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1124, __pyx_L27_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1012, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr26__pyx_v_p, __pyx_t_8); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1124, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_p, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_9 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_9); __pyx_t_8 = 0; - __pyx_t_10 = __pyx_v_self; - __Pyx_INCREF(__pyx_t_10); - __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr26__pyx_v_p}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1012, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_9genexpr30__pyx_v_p}; + __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1124, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_7); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1012, __pyx_L27_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1124, __pyx_L27_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_p); __pyx_9genexpr26__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_p); __pyx_9genexpr30__pyx_v_p = 0; goto __pyx_L31_exit_scope; __pyx_L27_error:; - __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_p); __pyx_9genexpr26__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_p); __pyx_9genexpr30__pyx_v_p = 0; goto __pyx_L1_error; __pyx_L31_exit_scope:; } /* exit inner scope */ __pyx_v_products = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1013 + /* "constraint/constraints.py":1125 * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] * products = [self._safe_product(p) for p in candidates] * return min(products), max(products) # <<<<<<<<<<<<<< @@ -27712,42 +28968,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_8 = __pyx_builtin_min; - __pyx_t_9 = 1; + __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_10 = __pyx_builtin_max; - __pyx_t_9 = 1; + __pyx_t_7 = NULL; + __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_products}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1013, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1013, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1013, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1125, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 1125, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_8 = 0; - __pyx_r = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/constraints.py":997 + /* "constraint/constraints.py":1109 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -27760,8 +29010,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); @@ -27773,16 +29023,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF(__pyx_v_dom); __Pyx_XDECREF(__pyx_v_candidates); __Pyx_XDECREF(__pyx_v_products); - __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_p); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1015 +/* "constraint/constraints.py":1127 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -27830,39 +29080,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_values,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1015, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1127, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1015, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1127, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1015, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1127, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_safe_product", 0) < 0) __PYX_ERR(0, 1015, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_safe_product", 0) < (0)) __PYX_ERR(0, 1127, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 1015, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 1127, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1015, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1127, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1015, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1127, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_values = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1015, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1127, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27897,7 +29147,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":1016 + /* "constraint/constraints.py":1128 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -27907,7 +29157,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; - /* "constraint/constraints.py":1017 + /* "constraint/constraints.py":1129 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -27919,9 +29169,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1129, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -27929,17 +29179,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1017, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1129, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1017, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1129, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -27950,13 +29200,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1017, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1129, __pyx_L1_error) PyErr_Clear(); } break; @@ -27966,19 +29216,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1018 + /* "constraint/constraints.py":1130 * prod = 1 * for v in values: * prod *= v # <<<<<<<<<<<<<< * return prod * */ - __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1017 + /* "constraint/constraints.py":1129 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -27988,7 +29238,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1019 + /* "constraint/constraints.py":1131 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -28000,7 +29250,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":1015 + /* "constraint/constraints.py":1127 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -28022,7 +29272,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1021 +/* "constraint/constraints.py":1133 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -28073,50 +29323,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1021, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1133, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1021, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1133, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1021, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1133, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1021, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1133, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1021, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1133, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1021, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1133, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 1021, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 1133, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1021, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1133, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1021, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1133, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1021, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1133, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1021, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1133, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1021, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1133, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1021, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1133, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -28126,7 +29376,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1021, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1133, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28137,9 +29387,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1021, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1021, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1021, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1133, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1133, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1133, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_25VariableMinProdConstraint_6preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -28187,7 +29437,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1022 + /* "constraint/constraints.py":1134 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -28195,9 +29445,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * t_min = min(target_dom) */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1022, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -28214,30 +29464,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1022, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1023 + /* "constraint/constraints.py":1135 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] # <<<<<<<<<<<<<< * t_min = min(target_dom) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_target_dom = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":1024 + /* "constraint/constraints.py":1136 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] * t_min = min(target_dom) # <<<<<<<<<<<<<< @@ -28245,73 +29495,70 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * for var in self.product_vars: */ __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_2 = __pyx_builtin_min; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_target_dom}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_t_min = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":1026 + /* "constraint/constraints.py":1138 * t_min = min(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1026, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1138, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1026, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1026, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1138, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_2); + __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1026, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1138, __pyx_L1_error) PyErr_Clear(); } break; @@ -28321,25 +29568,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1027 + /* "constraint/constraints.py":1139 * * for var in self.product_vars: * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< * dom = domains[var] * for val in dom[:]: */ - __pyx_t_1 = __pyx_v_self; - __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_v_domains}; - __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error) + PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_v_domains}; + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_exclude_var, __pyx_v_var, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1027, __pyx_L1_error) - __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_exclude_var, __pyx_v_var, __pyx_t_3, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1139, __pyx_L1_error) + __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1027, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -28348,40 +29595,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1027, __pyx_L1_error) + __PYX_ERR(0, 1139, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1139, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1139, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1027, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1027, __pyx_L1_error) + index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < (0)) __PYX_ERR(0, 1139, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -28389,79 +29636,79 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1027, __pyx_L1_error) + __PYX_ERR(0, 1139, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_min_others, __pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_max_others, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_max_others, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":1028 + /* "constraint/constraints.py":1140 * for var in self.product_vars: * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] # <<<<<<<<<<<<<< * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1028, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1029 + /* "constraint/constraints.py":1141 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: */ - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_dom, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_dom, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1029, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1141, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1141, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_10); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_10; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1029, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1141, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1029, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1141, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_11(__pyx_t_1); + __pyx_t_4 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1029, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1141, __pyx_L1_error) PyErr_Clear(); } break; @@ -28471,29 +29718,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1030 + /* "constraint/constraints.py":1142 * dom = domains[var] * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] # <<<<<<<<<<<<<< * if max(possible_prods) < t_min: * dom.remove(val) */ - __pyx_t_4 = PyNumber_Multiply(__pyx_v_val, __pyx_v_min_others); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_v_val, __pyx_v_min_others); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_val, __pyx_v_max_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_val, __pyx_v_max_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1030, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1030, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1142, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1030, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1142, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_possible_prods, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; - /* "constraint/constraints.py":1031 + /* "constraint/constraints.py":1143 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< @@ -28501,24 +29748,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * */ __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_4 = __pyx_builtin_max; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_possible_prods}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1031, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_v_t_min, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_8, __pyx_v_t_min, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1031, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_12) { - /* "constraint/constraints.py":1032 + /* "constraint/constraints.py":1144 * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: * dom.remove(val) # <<<<<<<<<<<<<< @@ -28530,14 +29774,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_val}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1031 + /* "constraint/constraints.py":1143 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if max(possible_prods) < t_min: # <<<<<<<<<<<<<< @@ -28546,7 +29790,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1029 + /* "constraint/constraints.py":1141 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< @@ -28554,9 +29798,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * if max(possible_prods) < t_min: */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1026 + /* "constraint/constraints.py":1138 * t_min = min(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -28564,9 +29808,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * dom = domains[var] */ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1021 + /* "constraint/constraints.py":1133 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -28599,7 +29843,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1034 +/* "constraint/constraints.py":1146 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -28650,53 +29894,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1034, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1146, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1034, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1034, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1034, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1034, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1034, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 1034, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 1146, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1034, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1146, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1034, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1146, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1034, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1146, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1034, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1146, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1034, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1146, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1034, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1146, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -28710,7 +29954,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1034, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1146, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28721,8 +29965,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1034, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1034, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1146, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1146, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_25VariableMinProdConstraint_8__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -28741,9 +29985,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":1070 +/* "constraint/constraints.py":1182 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): # <<<<<<<<<<<<<< @@ -28752,29 +29996,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint */ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint_8__call___genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_16_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1070, __pyx_L1_error) + __PYX_ERR(0, 1182, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator12, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint___call, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1070, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator11, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint___call, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -28790,9 +30034,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -28811,29 +30055,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1070, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1070, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1182, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1182, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1070, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1182, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1070, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value)) { __Pyx_RaiseClosureNameError("target_value"); __PYX_ERR(0, 1070, __pyx_L1_error) } - __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_p, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1070, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1070, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value)) { __Pyx_RaiseClosureNameError("target_value"); __PYX_ERR(0, 1182, __pyx_L1_error) } + __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_p, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1182, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { @@ -28873,7 +30117,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1034 +/* "constraint/constraints.py":1146 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -28882,7 +30126,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint */ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint_8__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *__pyx_cur_scope; PyObject *__pyx_v_assigned_prod = NULL; PyObject *__pyx_v_unassigned = NULL; PyObject *__pyx_v_var = NULL; @@ -28895,18 +30139,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_v_prods = NULL; - PyObject *__pyx_9genexpr27__pyx_v_v = NULL; - PyObject *__pyx_9genexpr28__pyx_v_p = NULL; - PyObject *__pyx_9genexpr29__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr29__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr30__pyx_v_c = NULL; PyObject *__pyx_9genexpr31__pyx_v_v = NULL; - PyObject *__pyx_9genexpr32__pyx_v_v = NULL; - PyObject *__pyx_9genexpr33__pyx_v_p = NULL; - PyObject *__pyx_9genexpr34__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr34__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr35__pyx_v_o = NULL; - PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator12 = 0; + PyObject *__pyx_9genexpr32__pyx_v_p = NULL; + PyObject *__pyx_9genexpr33__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr33__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr34__pyx_v_c = NULL; + PyObject *__pyx_9genexpr35__pyx_v_v = NULL; + PyObject *__pyx_9genexpr36__pyx_v_v = NULL; + PyObject *__pyx_9genexpr37__pyx_v_p = NULL; + PyObject *__pyx_9genexpr38__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr38__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr39__pyx_v_o = NULL; + PyObject *__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator11 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -28919,8 +30163,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - size_t __pyx_t_12; + size_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *(*__pyx_t_15)(PyObject *); @@ -28931,29 +30175,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_16___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_15___call__(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1034, __pyx_L1_error) + __PYX_ERR(0, 1146, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":1035 + /* "constraint/constraints.py":1147 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< * return True # Can't evaluate yet * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1035, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":1036 + /* "constraint/constraints.py":1148 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: * return True # Can't evaluate yet # <<<<<<<<<<<<<< @@ -28965,7 +30209,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1035 + /* "constraint/constraints.py":1147 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -28974,23 +30218,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1038 + /* "constraint/constraints.py":1150 * return True # Can't evaluate yet * * target_value = assignments[self.target_var] # <<<<<<<<<<<<<< * assigned_prod = 1 * unassigned = [] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_target_value = __pyx_t_3; __pyx_t_3 = 0; - /* "constraint/constraints.py":1039 + /* "constraint/constraints.py":1151 * * target_value = assignments[self.target_var] * assigned_prod = 1 # <<<<<<<<<<<<<< @@ -29000,35 +30244,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __pyx_v_assigned_prod = __pyx_mstate_global->__pyx_int_1; - /* "constraint/constraints.py":1040 + /* "constraint/constraints.py":1152 * target_value = assignments[self.target_var] * assigned_prod = 1 * unassigned = [] # <<<<<<<<<<<<<< * * for var in self.product_vars: */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_unassigned = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1042 + /* "constraint/constraints.py":1154 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< * if var in assignments: * assigned_prod *= assignments[var] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1042, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1042, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1042, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1154, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -29037,17 +30281,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1042, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1154, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1042, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1154, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -29058,13 +30302,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1042, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1154, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1042, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1154, __pyx_L1_error) PyErr_Clear(); } break; @@ -29074,32 +30318,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1043 + /* "constraint/constraints.py":1155 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< * assigned_prod *= assignments[var] * else: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1043, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1155, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":1044 + /* "constraint/constraints.py":1156 * for var in self.product_vars: * if var in assignments: * assigned_prod *= assignments[var] # <<<<<<<<<<<<<< * else: * unassigned.append(var) */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_assigned_prod, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1044, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_assigned_prod, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_assigned_prod, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1043 + /* "constraint/constraints.py":1155 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -29109,7 +30353,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L6; } - /* "constraint/constraints.py":1046 + /* "constraint/constraints.py":1158 * assigned_prod *= assignments[var] * else: * unassigned.append(var) # <<<<<<<<<<<<<< @@ -29117,11 +30361,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * if not unassigned: */ /*else*/ { - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_unassigned, __pyx_v_var); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1046, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_unassigned, __pyx_v_var); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1158, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":1042 + /* "constraint/constraints.py":1154 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -29131,19 +30375,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1048 + /* "constraint/constraints.py":1160 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< * return assigned_prod >= target_value * */ - __pyx_t_2 = (__Pyx_PyList_GET_SIZE(__pyx_v_unassigned) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 1048, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_unassigned); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1160, __pyx_L1_error) + __pyx_t_2 = (__pyx_temp != 0); + } + __pyx_t_8 = (!__pyx_t_2); if (__pyx_t_8) { - /* "constraint/constraints.py":1049 + /* "constraint/constraints.py":1161 * * if not unassigned: * return assigned_prod >= target_value # <<<<<<<<<<<<<< @@ -29151,12 +30399,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * # Estimate min possible value of full product */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_assigned_prod, __pyx_cur_scope->__pyx_v_target_value, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_assigned_prod, __pyx_cur_scope->__pyx_v_target_value, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1048 + /* "constraint/constraints.py":1160 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -29165,7 +30413,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1052 + /* "constraint/constraints.py":1164 * * # Estimate min possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] # <<<<<<<<<<<<<< @@ -29173,7 +30421,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * possible_prods = [assigned_prod * c for c in candidates] */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L11_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; @@ -29181,69 +30429,63 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1052, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1164, __pyx_L11_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr27__pyx_v_v, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr31__pyx_v_v, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_10 = __pyx_builtin_min; - __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr27__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1052, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = 1; + __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr31__pyx_v_v); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1164, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_11}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_11 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_9 = __pyx_builtin_max; - __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr27__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1052, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = 1; + __pyx_t_9 = NULL; + __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr31__pyx_v_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1164, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_13}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1052, __pyx_L11_error) + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_12}; + __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1164, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1052, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1164, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1052, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1164, __pyx_L11_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1052, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1164, __pyx_L11_error); __pyx_t_3 = 0; __pyx_t_10 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1052, __pyx_L11_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1164, __pyx_L11_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_v); __pyx_9genexpr27__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_v); __pyx_9genexpr31__pyx_v_v = 0; goto __pyx_L15_exit_scope; __pyx_L11_error:; - __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_v); __pyx_9genexpr27__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_v); __pyx_9genexpr31__pyx_v_v = 0; goto __pyx_L1_error; __pyx_L15_exit_scope:; } /* exit inner scope */ __pyx_v_domain_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1053 + /* "constraint/constraints.py":1165 * # Estimate min possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] # <<<<<<<<<<<<<< @@ -29251,26 +30493,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * if max(possible_prods) < target_value: */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L18_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1053, __pyx_L18_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1165, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_6); { /* enter inner scope */ - __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1053, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1165, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __pyx_v_domain_bounds; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1053, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1165, __pyx_L23_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1165, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; @@ -29278,40 +30520,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1053, __pyx_L23_error) + __PYX_ERR(0, 1165, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_9); + __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_13); - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_11); } else { - __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1053, __pyx_L23_error) + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1165, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1165, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1053, __pyx_L23_error) - __Pyx_XGOTREF(__pyx_t_11); } #else - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1053, __pyx_L23_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1165, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1165, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1053, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1053, __pyx_L23_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1165, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); - index = 0; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L26_unpacking_failed; + index = 0; __pyx_t_9 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_9)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L26_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); - index = 1; __pyx_t_11 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_11)) goto __pyx_L26_unpacking_failed; - __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1053, __pyx_L23_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1165, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -29319,118 +30561,118 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1053, __pyx_L23_error) + __PYX_ERR(0, 1165, __pyx_L23_error) __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_lo, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr33__pyx_v_lo, __pyx_t_9); + __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr33__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_hi, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __pyx_L23_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1165, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_9genexpr29__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr29__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_9genexpr29__pyx_v_lo) != (0)) __PYX_ERR(0, 1053, __pyx_L23_error); - __Pyx_INCREF(__pyx_9genexpr29__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr29__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr29__pyx_v_hi) != (0)) __PYX_ERR(0, 1053, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1053, __pyx_L23_error) + __Pyx_INCREF(__pyx_9genexpr33__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr33__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_9genexpr33__pyx_v_lo) != (0)) __PYX_ERR(0, 1165, __pyx_L23_error); + __Pyx_INCREF(__pyx_9genexpr33__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr33__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr33__pyx_v_hi) != (0)) __PYX_ERR(0, 1165, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1165, __pyx_L23_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_hi); __pyx_9genexpr29__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_lo); __pyx_9genexpr29__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_hi); __pyx_9genexpr33__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_lo); __pyx_9genexpr33__pyx_v_lo = 0; goto __pyx_L29_exit_scope; __pyx_L23_error:; - __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_hi); __pyx_9genexpr29__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_lo); __pyx_9genexpr29__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_hi); __pyx_9genexpr33__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_lo); __pyx_9genexpr33__pyx_v_lo = 0; goto __pyx_L18_error; __pyx_L29_exit_scope:; } /* exit inner scope */ - __pyx_t_10 = PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1053, __pyx_L18_error) + __pyx_t_10 = PySequence_Tuple(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1165, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1053, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1165, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { - __pyx_t_10 = __pyx_t_9; __Pyx_INCREF(__pyx_t_10); + if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) { + __pyx_t_10 = __pyx_t_12; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1053, __pyx_L18_error) + __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1165, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1053, __pyx_L18_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1165, __pyx_L18_error) } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_10))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1053, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1165, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_4); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1053, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1165, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4)); + __pyx_t_12 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4)); #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); + __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1053, __pyx_L18_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1165, __pyx_L18_error) } else { - __pyx_t_9 = __pyx_t_5(__pyx_t_10); - if (unlikely(!__pyx_t_9)) { + __pyx_t_12 = __pyx_t_5(__pyx_t_10); + if (unlikely(!__pyx_t_12)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1053, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1165, __pyx_L18_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr28__pyx_v_p, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr32__pyx_v_p, __pyx_t_12); + __pyx_t_12 = 0; __pyx_t_6 = __pyx_v_self; __Pyx_INCREF(__pyx_t_6); - __pyx_t_12 = 0; + __pyx_t_11 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr28__pyx_v_p}; - __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr32__pyx_v_p}; + __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1053, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_9); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1165, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_12); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1053, __pyx_L18_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1165, __pyx_L18_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_p); __pyx_9genexpr28__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_p); __pyx_9genexpr32__pyx_v_p = 0; goto __pyx_L31_exit_scope; __pyx_L18_error:; - __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_p); __pyx_9genexpr28__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_p); __pyx_9genexpr32__pyx_v_p = 0; goto __pyx_L1_error; __pyx_L31_exit_scope:; } /* exit inner scope */ __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1054 + /* "constraint/constraints.py":1166 * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] * possible_prods = [assigned_prod * c for c in candidates] # <<<<<<<<<<<<<< @@ -29438,7 +30680,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * return False */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1054, __pyx_L34_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -29446,33 +30688,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1054, __pyx_L34_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1166, __pyx_L34_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_4); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1054, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_c, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_9genexpr30__pyx_v_c); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1054, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1054, __pyx_L34_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1166, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_c, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_9genexpr34__pyx_v_c); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1166, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_12); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1166, __pyx_L34_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_c); __pyx_9genexpr30__pyx_v_c = 0; + __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_c); __pyx_9genexpr34__pyx_v_c = 0; goto __pyx_L38_exit_scope; __pyx_L34_error:; - __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_c); __pyx_9genexpr30__pyx_v_c = 0; + __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_c); __pyx_9genexpr34__pyx_v_c = 0; goto __pyx_L1_error; __pyx_L38_exit_scope:; } /* exit inner scope */ __pyx_v_possible_prods = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1055 + /* "constraint/constraints.py":1167 * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] * possible_prods = [assigned_prod * c for c in candidates] * if max(possible_prods) < target_value: # <<<<<<<<<<<<<< @@ -29480,24 +30722,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * */ __pyx_t_10 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_9 = __pyx_builtin_max; - __pyx_t_12 = 1; + __pyx_t_11 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_possible_prods}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1055, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_cur_scope->__pyx_v_target_value, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1055, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_cur_scope->__pyx_v_target_value, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1055, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1167, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1056 + /* "constraint/constraints.py":1168 * possible_prods = [assigned_prod * c for c in candidates] * if max(possible_prods) < target_value: * return False # <<<<<<<<<<<<<< @@ -29509,7 +30748,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1055 + /* "constraint/constraints.py":1167 * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] * possible_prods = [assigned_prod * c for c in candidates] * if max(possible_prods) < target_value: # <<<<<<<<<<<<<< @@ -29518,41 +30757,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1058 + /* "constraint/constraints.py":1170 * return False * * if forwardcheck: # <<<<<<<<<<<<<< * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1058, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1059 + /* "constraint/constraints.py":1171 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: */ - __pyx_t_9 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_9); + __pyx_t_10 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1059, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1171, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_4); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1059, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1060 + /* "constraint/constraints.py":1172 * if forwardcheck: * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] # <<<<<<<<<<<<<< @@ -29560,54 +30799,58 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * bounds = [(min(domains[v]), max(domains[v])) for v in other_unassigned] */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L45_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_10); + __pyx_t_12 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_12); __pyx_t_16 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1060, __pyx_L45_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1172, __pyx_L45_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_16); + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1060, __pyx_L45_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1172, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr31__pyx_v_v, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr35__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_9genexpr31__pyx_v_v, __pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1060, __pyx_L45_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1060, __pyx_L45_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_9genexpr35__pyx_v_v, __pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1172, __pyx_L45_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1172, __pyx_L45_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_8) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr31__pyx_v_v))) __PYX_ERR(0, 1060, __pyx_L45_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr35__pyx_v_v))) __PYX_ERR(0, 1172, __pyx_L45_error) } } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_v); __pyx_9genexpr31__pyx_v_v = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_v); __pyx_9genexpr35__pyx_v_v = 0; goto __pyx_L50_exit_scope; __pyx_L45_error:; - __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_v); __pyx_9genexpr31__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_v); __pyx_9genexpr35__pyx_v_v = 0; goto __pyx_L1_error; __pyx_L50_exit_scope:; } /* exit inner scope */ __Pyx_XDECREF_SET(__pyx_v_other_unassigned, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1061 + /* "constraint/constraints.py":1173 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< * bounds = [(min(domains[v]), max(domains[v])) for v in other_unassigned] * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] */ - __pyx_t_8 = (__Pyx_PyList_GET_SIZE(__pyx_v_other_unassigned) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_8 < 0))) __PYX_ERR(0, 1061, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_other_unassigned); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_8 = (__pyx_temp != 0); + } + if (__pyx_t_8) { - /* "constraint/constraints.py":1062 + /* "constraint/constraints.py":1174 * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: * bounds = [(min(domains[v]), max(domains[v])) for v in other_unassigned] # <<<<<<<<<<<<<< @@ -29615,77 +30858,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * else: */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __pyx_L54_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1174, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __pyx_v_other_unassigned; __Pyx_INCREF(__pyx_t_10); + __pyx_t_12 = __pyx_v_other_unassigned; __Pyx_INCREF(__pyx_t_12); __pyx_t_16 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1062, __pyx_L54_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1174, __pyx_L54_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_16); + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1062, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1174, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr32__pyx_v_v, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr36__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_11 = __pyx_builtin_min; - __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr32__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1062, __pyx_L54_error) + __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr36__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1174, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = 1; + __pyx_t_11 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_13}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1062, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1174, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); } - __pyx_t_13 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_3 = __pyx_builtin_max; - __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr32__pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1062, __pyx_L54_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_12 = 1; + __pyx_t_3 = NULL; + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr36__pyx_v_v); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1174, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1062, __pyx_L54_error) - __Pyx_GOTREF(__pyx_t_11); + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9}; + __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1174, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_13); } - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L54_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1174, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1062, __pyx_L54_error); - __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1062, __pyx_L54_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1174, __pyx_L54_error); + __Pyx_GIVEREF(__pyx_t_13); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 1174, __pyx_L54_error); __pyx_t_6 = 0; - __pyx_t_11 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1062, __pyx_L54_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_13 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1174, __pyx_L54_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_v); __pyx_9genexpr32__pyx_v_v = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_v); __pyx_9genexpr36__pyx_v_v = 0; goto __pyx_L58_exit_scope; __pyx_L54_error:; - __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_v); __pyx_9genexpr32__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_v); __pyx_9genexpr36__pyx_v_v = 0; goto __pyx_L1_error; __pyx_L58_exit_scope:; } /* exit inner scope */ __Pyx_XDECREF_SET(__pyx_v_bounds, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1063 + /* "constraint/constraints.py":1175 * if other_unassigned: * bounds = [(min(domains[v]), max(domains[v])) for v in other_unassigned] * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -29693,26 +30930,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * other_products = [1] */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L61_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1063, __pyx_L61_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1175, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_12); { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L66_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_11); + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1175, __pyx_L66_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_13); __pyx_t_16 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1063, __pyx_L66_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1175, __pyx_L66_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_11, __pyx_t_16); + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1063, __pyx_L66_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1175, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_6); if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; @@ -29720,40 +30957,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1063, __pyx_L66_error) + __PYX_ERR(0, 1175, __pyx_L66_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_14); - __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_13); } else { - __pyx_t_14 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1063, __pyx_L66_error) + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L66_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1175, __pyx_L66_error) __Pyx_XGOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1063, __pyx_L66_error) - __Pyx_XGOTREF(__pyx_t_13); } #else - __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1063, __pyx_L66_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L66_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1175, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1063, __pyx_L66_error) - __Pyx_GOTREF(__pyx_t_13); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; - __pyx_t_17 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1063, __pyx_L66_error) + __pyx_t_17 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1175, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_17); - index = 0; __pyx_t_14 = __pyx_t_15(__pyx_t_17); if (unlikely(!__pyx_t_14)) goto __pyx_L69_unpacking_failed; + index = 0; __pyx_t_3 = __pyx_t_15(__pyx_t_17); if (unlikely(!__pyx_t_3)) goto __pyx_L69_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_14 = __pyx_t_15(__pyx_t_17); if (unlikely(!__pyx_t_14)) goto __pyx_L69_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); - index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_17); if (unlikely(!__pyx_t_13)) goto __pyx_L69_unpacking_failed; - __Pyx_GOTREF(__pyx_t_13); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_17), 2) < 0) __PYX_ERR(0, 1063, __pyx_L66_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_17), 2) < (0)) __PYX_ERR(0, 1175, __pyx_L66_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L70_unpacking_done; @@ -29761,118 +30998,118 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_15 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1063, __pyx_L66_error) + __PYX_ERR(0, 1175, __pyx_L66_error) __pyx_L70_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_lo, __pyx_t_14); + __Pyx_XDECREF_SET(__pyx_9genexpr38__pyx_v_lo, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr38__pyx_v_hi, __pyx_t_14); __pyx_t_14 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_hi, __pyx_t_13); - __pyx_t_13 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1063, __pyx_L66_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1175, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_9genexpr34__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr34__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr34__pyx_v_lo) != (0)) __PYX_ERR(0, 1063, __pyx_L66_error); - __Pyx_INCREF(__pyx_9genexpr34__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr34__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr34__pyx_v_hi) != (0)) __PYX_ERR(0, 1063, __pyx_L66_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1063, __pyx_L66_error) + __Pyx_INCREF(__pyx_9genexpr38__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr38__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr38__pyx_v_lo) != (0)) __PYX_ERR(0, 1175, __pyx_L66_error); + __Pyx_INCREF(__pyx_9genexpr38__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr38__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr38__pyx_v_hi) != (0)) __PYX_ERR(0, 1175, __pyx_L66_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1175, __pyx_L66_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_hi); __pyx_9genexpr34__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_lo); __pyx_9genexpr34__pyx_v_lo = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_hi); __pyx_9genexpr38__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_lo); __pyx_9genexpr38__pyx_v_lo = 0; goto __pyx_L72_exit_scope; __pyx_L66_error:; - __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_hi); __pyx_9genexpr34__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_lo); __pyx_9genexpr34__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_hi); __pyx_9genexpr38__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_lo); __pyx_9genexpr38__pyx_v_lo = 0; goto __pyx_L61_error; __pyx_L72_exit_scope:; } /* exit inner scope */ - __pyx_t_11 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1063, __pyx_L61_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L61_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_11 = __pyx_t_3; __Pyx_INCREF(__pyx_t_11); + __pyx_t_13 = PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1175, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1175, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_13 = __pyx_t_9; __Pyx_INCREF(__pyx_t_13); __pyx_t_16 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_16 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1063, __pyx_L61_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1063, __pyx_L61_error) + __pyx_t_16 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1175, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1175, __pyx_L61_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_11))) { + if (likely(PyList_CheckExact(__pyx_t_13))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1063, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1175, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_11, __pyx_t_16); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_13); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1063, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1175, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_16)); + __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_16)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_16); + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_16); #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L61_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1175, __pyx_L61_error) } else { - __pyx_t_3 = __pyx_t_5(__pyx_t_11); - if (unlikely(!__pyx_t_3)) { + __pyx_t_9 = __pyx_t_5(__pyx_t_13); + if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1063, __pyx_L61_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1175, __pyx_L61_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr33__pyx_v_p, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_10 = __pyx_v_self; - __Pyx_INCREF(__pyx_t_10); - __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_9); + __Pyx_XDECREF_SET(__pyx_9genexpr37__pyx_v_p, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_12 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_12); + __pyx_t_11 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr33__pyx_v_p}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L61_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_9genexpr37__pyx_v_p}; + __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1175, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_9); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1063, __pyx_L61_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1175, __pyx_L61_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_p); __pyx_9genexpr33__pyx_v_p = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_p); __pyx_9genexpr37__pyx_v_p = 0; goto __pyx_L74_exit_scope; __pyx_L61_error:; - __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_p); __pyx_9genexpr33__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_p); __pyx_9genexpr37__pyx_v_p = 0; goto __pyx_L1_error; __pyx_L74_exit_scope:; } /* exit inner scope */ __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1061 + /* "constraint/constraints.py":1173 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -29882,7 +31119,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint goto __pyx_L51; } - /* "constraint/constraints.py":1065 + /* "constraint/constraints.py":1177 * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] * else: * other_products = [1] # <<<<<<<<<<<<<< @@ -29890,81 +31127,81 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * domain = domains[var] */ /*else*/ { - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 1065, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 1177, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; } __pyx_L51:; - /* "constraint/constraints.py":1067 + /* "constraint/constraints.py":1179 * other_products = [1] * * domain = domains[var] # <<<<<<<<<<<<<< * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1068 + /* "constraint/constraints.py":1180 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_11 = __pyx_t_1; __Pyx_INCREF(__pyx_t_11); + __pyx_t_13 = __pyx_t_1; __Pyx_INCREF(__pyx_t_13); __pyx_t_16 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_16 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1068, __pyx_L1_error) + __pyx_t_16 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1180, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1180, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_11))) { + if (likely(PyList_CheckExact(__pyx_t_13))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_11, __pyx_t_16); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_13); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1180, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_16)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_16)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_16); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_16); #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_11); + __pyx_t_1 = __pyx_t_5(__pyx_t_13); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1068, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1180, __pyx_L1_error) PyErr_Clear(); } break; @@ -29974,7 +31211,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1069 + /* "constraint/constraints.py":1181 * domain = domains[var] * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] # <<<<<<<<<<<<<< @@ -29982,60 +31219,60 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * domain.hideValue(val) */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1069, __pyx_L79_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_3); + __pyx_t_9 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_9); __pyx_t_18 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1069, __pyx_L79_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1181, __pyx_L79_error) #endif if (__pyx_t_18 >= __pyx_temp) break; } - __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_18); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_18; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1069, __pyx_L79_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr35__pyx_v_o, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_v_val); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1069, __pyx_L79_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_10, __pyx_9genexpr35__pyx_v_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1069, __pyx_L79_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1181, __pyx_L79_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr39__pyx_v_o, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_v_val); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1181, __pyx_L79_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = PyNumber_Multiply(__pyx_t_12, __pyx_9genexpr39__pyx_v_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1181, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1069, __pyx_L79_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1181, __pyx_L79_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_o); __pyx_9genexpr35__pyx_v_o = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_o); __pyx_9genexpr39__pyx_v_o = 0; goto __pyx_L83_exit_scope; __pyx_L79_error:; - __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_o); __pyx_9genexpr35__pyx_v_o = 0; + __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_o); __pyx_9genexpr39__pyx_v_o = 0; goto __pyx_L1_error; __pyx_L83_exit_scope:; } /* exit inner scope */ __Pyx_XDECREF_SET(__pyx_v_prods, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1070 + /* "constraint/constraints.py":1182 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): # <<<<<<<<<<<<<< * domain.hideValue(val) * if not domain: */ - __pyx_t_1 = __pyx_pf_10constraint_11constraints_25VariableMinProdConstraint_8__call___genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_prods); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10constraint_11constraints_25VariableMinProdConstraint_8__call___genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_prods); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1070, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1070, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1182, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1071 + /* "constraint/constraints.py":1183 * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): * domain.hideValue(val) # <<<<<<<<<<<<<< @@ -30044,17 +31281,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ __pyx_t_1 = __pyx_v_domain; __Pyx_INCREF(__pyx_t_1); - __pyx_t_12 = 0; + __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_val}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1070 + /* "constraint/constraints.py":1182 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p < target_value for p in prods): # <<<<<<<<<<<<<< @@ -30063,7 +31300,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1068 + /* "constraint/constraints.py":1180 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< @@ -30071,20 +31308,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * if all(p < target_value for p in prods): */ } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":1072 + /* "constraint/constraints.py":1184 * if all(p < target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< * return False * */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1072, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1184, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_8); if (__pyx_t_2) { - /* "constraint/constraints.py":1073 + /* "constraint/constraints.py":1185 * domain.hideValue(val) * if not domain: * return False # <<<<<<<<<<<<<< @@ -30094,10 +31331,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1072 + /* "constraint/constraints.py":1184 * if all(p < target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< @@ -30106,7 +31343,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1059 + /* "constraint/constraints.py":1171 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -30114,9 +31351,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint * if other_unassigned: */ } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":1058 + /* "constraint/constraints.py":1170 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -30125,7 +31362,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint */ } - /* "constraint/constraints.py":1075 + /* "constraint/constraints.py":1187 * return False * * return True # <<<<<<<<<<<<<< @@ -30137,7 +31374,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1034 + /* "constraint/constraints.py":1146 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -30152,7 +31389,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_17); @@ -30171,28 +31408,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMinProdConstraint __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_val); __Pyx_XDECREF(__pyx_v_prods); - __Pyx_XDECREF(__pyx_9genexpr27__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr28__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr29__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr30__pyx_v_c); __Pyx_XDECREF(__pyx_9genexpr31__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_o); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator12); + __Pyx_XDECREF(__pyx_9genexpr32__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr33__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr34__pyx_v_c); + __Pyx_XDECREF(__pyx_9genexpr35__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr36__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr37__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_o); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_25VariableMinProdConstraint_8__call___2generator11); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1089 +/* "constraint/constraints.py":1206 * """ * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, maxprod: int | float): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * */ @@ -30238,39 +31475,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_maxprod,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1089, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1206, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1089, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1206, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1089, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1206, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 1089, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1206, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1089, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1206, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1089, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1206, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1089, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1206, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_maxprod = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1089, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1206, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30294,24 +31531,37 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_maxprod) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1095 + /* "constraint/constraints.py":1212 * maxprod: Value to be considered as the maximum product * """ * self._maxprod = maxprod # <<<<<<<<<<<<<< + * self._variable_contains_lt1: list[bool] = list() + * +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2, __pyx_v_maxprod) < (0)) __PYX_ERR(0, 1212, __pyx_L1_error) + + /* "constraint/constraints.py":1213 + * """ + * self._maxprod = maxprod + * self._variable_contains_lt1: list[bool] = list() # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2, __pyx_v_maxprod) < 0) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1, __pyx_t_1) < (0)) __PYX_ERR(0, 1213, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1089 + /* "constraint/constraints.py":1206 * """ * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, maxprod: int | float): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * */ @@ -30320,6 +31570,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -30328,8 +31579,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ return __pyx_r; } -/* "constraint/constraints.py":1097 - * self._maxprod = maxprod +/* "constraint/constraints.py":1215 + * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -30379,50 +31630,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1097, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1215, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1097, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1215, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1097, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1215, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1097, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1215, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1097, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1215, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1097, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1215, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 1097, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 1215, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1097, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1215, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1097, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1215, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1097, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1215, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1097, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1215, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1097, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1215, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1097, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1215, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -30432,7 +31683,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1097, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1215, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30443,9 +31694,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1097, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1097, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1097, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1215, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1215, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1215, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_17MaxProdConstraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -30464,9 +31715,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":1104 +/* "constraint/constraints.py":1222 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< @@ -30475,18 +31726,18 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr */ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_10preProcess_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_18_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1104, __pyx_L1_error) + __PYX_ERR(0, 1222, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -30494,7 +31745,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_10prePr __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator13, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint_preProcess_loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator12, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint_preProcess_loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -30510,9 +31761,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_10prePr return __pyx_r; } -static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -30531,16 +31782,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1104, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1104, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1222, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1222, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1222, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -30548,17 +31799,17 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1104, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1222, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1104, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1222, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -30569,13 +31820,13 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1222, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1104, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1222, __pyx_L1_error) PyErr_Clear(); } break; @@ -30586,8 +31837,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_value, __pyx_mstate_global->__pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_value, __pyx_mstate_global->__pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1222, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_XDECREF(__pyx_r); @@ -30626,8 +31877,8 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr return __pyx_r; } -/* "constraint/constraints.py":1097 - * self._maxprod = maxprod +/* "constraint/constraints.py":1215 + * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -30641,7 +31892,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro PyObject *__pyx_v_maxprod = NULL; PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_value = NULL; - PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator13 = 0; + PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator12 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -30663,7 +31914,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1098 + /* "constraint/constraints.py":1216 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -30671,9 +31922,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * # check if there are any values less than 1 in the associated variables */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1098, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1098, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -30690,27 +31941,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1098, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1101 + /* "constraint/constraints.py":1219 * * # check if there are any values less than 1 in the associated variables * self._variable_contains_lt1: list[bool] = list() # <<<<<<<<<<<<<< * variable_with_lt1 = None * for variable in variables: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1, __pyx_t_1) < 0) __PYX_ERR(0, 1101, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1, __pyx_t_1) < (0)) __PYX_ERR(0, 1219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1102 + /* "constraint/constraints.py":1220 * # check if there are any values less than 1 in the associated variables * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None # <<<<<<<<<<<<<< @@ -30720,7 +31971,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_INCREF(Py_None); __pyx_v_variable_with_lt1 = Py_None; - /* "constraint/constraints.py":1103 + /* "constraint/constraints.py":1221 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -30732,9 +31983,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1221, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -30742,17 +31993,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1103, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1221, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1103, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1221, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -30763,13 +32014,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1103, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1221, __pyx_L1_error) PyErr_Clear(); } break; @@ -30779,37 +32030,37 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1104 + /* "constraint/constraints.py":1222 * variable_with_lt1 = None * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_pf_10constraint_11constraints_17MaxProdConstraint_10preProcess_genexpr(NULL, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_11constraints_17MaxProdConstraint_10preProcess_genexpr(NULL, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1105 + /* "constraint/constraints.py":1223 * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) * self._variable_contains_lt1.append(contains_lt1) # <<<<<<<<<<<<<< * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1105, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_v_contains_lt1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1105, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_v_contains_lt1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1103 + /* "constraint/constraints.py":1221 * self._variable_contains_lt1: list[bool] = list() * variable_with_lt1 = None * for variable in variables: # <<<<<<<<<<<<<< @@ -30819,7 +32070,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1106 + /* "constraint/constraints.py":1224 * contains_lt1 = any(value < 1 for value in domains[variable]) * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< @@ -30827,18 +32078,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * if variable_with_lt1 is not None: */ __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_2 = __pyx_builtin_zip; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_variables, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_variables, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1106, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -30846,9 +32094,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1224, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -30857,17 +32105,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1106, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1224, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1106, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1224, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -30878,13 +32126,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1106, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1106, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1224, __pyx_L1_error) PyErr_Clear(); } break; @@ -30897,40 +32145,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1106, __pyx_L1_error) + __PYX_ERR(0, 1224, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1106, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); - index = 0; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; + index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 1106, __pyx_L1_error) + index = 1; __pyx_t_3 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 1224, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; @@ -30938,15 +32186,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1106, __pyx_L1_error) + __PYX_ERR(0, 1224, __pyx_L1_error) __pyx_L9_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_3); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_4); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_3); + __pyx_t_3 = 0; - /* "constraint/constraints.py":1107 + /* "constraint/constraints.py":1225 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -30956,7 +32204,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __pyx_t_11 = (__pyx_v_contains_lt1 == Py_True); if (__pyx_t_11) { - /* "constraint/constraints.py":1108 + /* "constraint/constraints.py":1226 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -30966,7 +32214,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __pyx_t_11 = (__pyx_v_variable_with_lt1 != Py_None); if (__pyx_t_11) { - /* "constraint/constraints.py":1110 + /* "constraint/constraints.py":1228 * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune * return # <<<<<<<<<<<<<< @@ -30978,7 +32226,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1108 + /* "constraint/constraints.py":1226 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< @@ -30987,7 +32235,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1111 + /* "constraint/constraints.py":1229 * # if more than one associated variables contain less than 1, we can't prune * return * variable_with_lt1 = variable # <<<<<<<<<<<<<< @@ -30997,7 +32245,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_INCREF(__pyx_v_variable); __Pyx_DECREF_SET(__pyx_v_variable_with_lt1, __pyx_v_variable); - /* "constraint/constraints.py":1107 + /* "constraint/constraints.py":1225 * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if contains_lt1 is True: # <<<<<<<<<<<<<< @@ -31006,7 +32254,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1106 + /* "constraint/constraints.py":1224 * contains_lt1 = any(value < 1 for value in domains[variable]) * self._variable_contains_lt1.append(contains_lt1) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< @@ -31016,19 +32264,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1114 + /* "constraint/constraints.py":1232 * * # prune the associated variables of values > maxprod * maxprod = self._maxprod # <<<<<<<<<<<<<< * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1114, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_maxprod = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/constraints.py":1115 + /* "constraint/constraints.py":1233 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -31040,9 +32288,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1115, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1233, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -31050,17 +32298,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1115, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -31071,13 +32319,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1115, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1233, __pyx_L1_error) PyErr_Clear(); } break; @@ -31087,7 +32335,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1116 + /* "constraint/constraints.py":1234 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -31100,14 +32348,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __pyx_t_11 = __pyx_t_12; goto __pyx_L16_bool_binop_done; } - __pyx_t_1 = PyObject_RichCompare(__pyx_v_variable_with_lt1, __pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1116, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_variable_with_lt1, __pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __pyx_t_12; __pyx_L16_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":1117 + /* "constraint/constraints.py":1235 * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue # <<<<<<<<<<<<<< @@ -31116,7 +32364,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ goto __pyx_L13_continue; - /* "constraint/constraints.py":1116 + /* "constraint/constraints.py":1234 * maxprod = self._maxprod * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< @@ -31125,71 +32373,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro */ } - /* "constraint/constraints.py":1118 + /* "constraint/constraints.py":1236 * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value > maxprod: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1119 + /* "constraint/constraints.py":1237 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if value > maxprod: * domain.remove(value) */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1237, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { + if (likely(PyList_CheckExact(__pyx_t_3))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1119, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1237, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_13); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_13; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1119, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1237, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); #endif ++__pyx_t_13; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1119, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_4); + __pyx_t_1 = __pyx_t_14(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1119, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1237, __pyx_L1_error) PyErr_Clear(); } break; @@ -31199,38 +32447,38 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1120 + /* "constraint/constraints.py":1238 * domain = domains[variable] * for value in domain[:]: * if value > maxprod: # <<<<<<<<<<<<<< * domain.remove(value) * elif value == 0 and maxprod < 0: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1120, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1238, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { - /* "constraint/constraints.py":1121 + /* "constraint/constraints.py":1239 * for value in domain[:]: * if value > maxprod: * domain.remove(value) # <<<<<<<<<<<<<< * elif value == 0 and maxprod < 0: * domain.remove(value) */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_value}; + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1120 + /* "constraint/constraints.py":1238 * domain = domains[variable] * for value in domain[:]: * if value > maxprod: # <<<<<<<<<<<<<< @@ -31240,46 +32488,46 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro goto __pyx_L20; } - /* "constraint/constraints.py":1122 + /* "constraint/constraints.py":1240 * if value > maxprod: * domain.remove(value) * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< * domain.remove(value) * */ - __pyx_t_12 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1122, __pyx_L1_error) + __pyx_t_12 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1240, __pyx_L1_error) if (__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L21_bool_binop_done; } - __pyx_t_1 = PyObject_RichCompare(__pyx_v_maxprod, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1122, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_maxprod, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_11 = __pyx_t_12; __pyx_L21_bool_binop_done:; if (__pyx_t_11) { - /* "constraint/constraints.py":1123 + /* "constraint/constraints.py":1241 * domain.remove(value) * elif value == 0 and maxprod < 0: * domain.remove(value) # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 */ - __pyx_t_3 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_value}; + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1122 + /* "constraint/constraints.py":1240 * if value > maxprod: * domain.remove(value) * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< @@ -31289,7 +32537,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __pyx_L20:; - /* "constraint/constraints.py":1119 + /* "constraint/constraints.py":1237 * continue * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -31297,9 +32545,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * domain.remove(value) */ } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1115 + /* "constraint/constraints.py":1233 * # prune the associated variables of values > maxprod * maxprod = self._maxprod * for variable in variables: # <<<<<<<<<<<<<< @@ -31310,8 +32558,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1097 - * self._maxprod = maxprod + /* "constraint/constraints.py":1215 + * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -31336,13 +32584,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro __Pyx_XDECREF(__pyx_v_maxprod); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); - __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator13); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator12); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1125 +/* "constraint/constraints.py":1243 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -31393,53 +32641,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1125, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1243, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1243, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1243, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1243, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1243, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1243, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 1125, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 1243, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1125, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1243, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1243, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1243, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1243, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1243, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1125, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1243, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -31453,7 +32701,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1125, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1243, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31464,8 +32712,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1125, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1125, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1243, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1243, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -31484,6 +32732,175 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call___2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/constraints.py":1251 + * if len(self._variable_contains_lt1) != len(variables): + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) # <<<<<<<<<<<<<< + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_8__call___genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_18_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 1251, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call___2generator13, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint___call___local, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1251, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__call__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call___2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1251, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1251, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1251, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_2; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); + #endif + ++__pyx_t_2; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1251, __pyx_L1_error) + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1251, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_value); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_value, __pyx_mstate_global->__pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1251, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1251, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1243 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * maxprod = self._maxprod + * prod = 1 +*/ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck) { PyObject *__pyx_v_maxprod = NULL; @@ -31494,40 +32911,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call PyObject *__pyx_v_contains_lt1 = NULL; PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_value = NULL; + PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call___2generator13 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); + Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - PyObject *(*__pyx_t_9)(PyObject *); - int __pyx_t_10; - int __pyx_t_11; - int __pyx_t_12; - Py_ssize_t __pyx_t_13; + int __pyx_t_9; + size_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; PyObject *(*__pyx_t_14)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1126 + /* "constraint/constraints.py":1244 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * maxprod = self._maxprod # <<<<<<<<<<<<<< * prod = 1 * missing = False */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxprod = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1127 + /* "constraint/constraints.py":1245 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * maxprod = self._maxprod * prod = 1 # <<<<<<<<<<<<<< @@ -31537,93 +32955,204 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; - /* "constraint/constraints.py":1128 + /* "constraint/constraints.py":1246 * maxprod = self._maxprod * prod = 1 * missing = False # <<<<<<<<<<<<<< * missing_lt1 = [] - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * # find out which variables contain values less than 1 if not preprocessed */ __pyx_v_missing = 0; - /* "constraint/constraints.py":1129 + /* "constraint/constraints.py":1247 * prod = 1 * missing = False * missing_lt1 = [] # <<<<<<<<<<<<<< - * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): - * if variable in assignments: + * # find out which variables contain values less than 1 if not preprocessed + * if len(self._variable_contains_lt1) != len(variables): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_missing_lt1 = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1130 - * missing = False + /* "constraint/constraints.py":1249 * missing_lt1 = [] + * # find out which variables contain values less than 1 if not preprocessed + * if len(self._variable_contains_lt1) != len(variables): # <<<<<<<<<<<<<< + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1249, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1249, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_2 != __pyx_t_3); + if (__pyx_t_4) { + + /* "constraint/constraints.py":1250 + * # find out which variables contain values less than 1 if not preprocessed + * if len(self._variable_contains_lt1) != len(variables): + * for variable in variables: # <<<<<<<<<<<<<< + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): +*/ + if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { + __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1250, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1250, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_3; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1250, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); + #else + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); + #endif + ++__pyx_t_3; + } + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1250, __pyx_L1_error) + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1250, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_6); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); + __pyx_t_6 = 0; + + /* "constraint/constraints.py":1251 + * if len(self._variable_contains_lt1) != len(variables): + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) # <<<<<<<<<<<<<< + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): + * if variable in assignments: +*/ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __pyx_pf_10constraint_11constraints_17MaxProdConstraint_8__call___genexpr(NULL, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1251, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "constraint/constraints.py":1250 + * # find out which variables contain values less than 1 if not preprocessed + * if len(self._variable_contains_lt1) != len(variables): + * for variable in variables: # <<<<<<<<<<<<<< + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) + * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): +*/ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/constraints.py":1249 + * missing_lt1 = [] + * # find out which variables contain values less than 1 if not preprocessed + * if len(self._variable_contains_lt1) != len(variables): # <<<<<<<<<<<<<< + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) +*/ + } + + /* "constraint/constraints.py":1252 + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< * if variable in assignments: * prod *= assignments[variable] */ - __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_3 = __pyx_builtin_zip; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; + __pyx_t_7 = NULL; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variable_contains_lt1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_variables, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1130, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_variables, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); + __pyx_t_3 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1130, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1252, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1130, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1252, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_3; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1130, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1252, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_3)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_3); #endif - ++__pyx_t_6; + ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1130, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_3); + __pyx_t_1 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1130, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1252, __pyx_L1_error) PyErr_Clear(); } break; @@ -31636,91 +33165,91 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1130, __pyx_L1_error) + __PYX_ERR(0, 1252, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_2); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_7); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1130, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1252, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1252, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1130, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); - index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1130, __pyx_L1_error) - __pyx_t_9 = NULL; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L6_unpacking_done; - __pyx_L5_unpacking_failed:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = NULL; + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); + index = 0; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + index = 1; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < (0)) __PYX_ERR(0, 1252, __pyx_L1_error) + __pyx_t_12 = NULL; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + goto __pyx_L10_unpacking_done; + __pyx_L9_unpacking_failed:; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1130, __pyx_L1_error) - __pyx_L6_unpacking_done:; + __PYX_ERR(0, 1252, __pyx_L1_error) + __pyx_L10_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":1131 - * missing_lt1 = [] + /* "constraint/constraints.py":1253 + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: # <<<<<<<<<<<<<< * prod *= assignments[variable] * else: */ - __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1131, __pyx_L1_error) - if (__pyx_t_10) { + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1253, __pyx_L1_error) + if (__pyx_t_4) { - /* "constraint/constraints.py":1132 + /* "constraint/constraints.py":1254 * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: * prod *= assignments[variable] # <<<<<<<<<<<<<< * else: * missing = True */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":1131 - * missing_lt1 = [] + /* "constraint/constraints.py":1253 + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): * if variable in assignments: # <<<<<<<<<<<<<< * prod *= assignments[variable] * else: */ - goto __pyx_L7; + goto __pyx_L11; } - /* "constraint/constraints.py":1134 + /* "constraint/constraints.py":1256 * prod *= assignments[variable] * else: * missing = True # <<<<<<<<<<<<<< @@ -31730,26 +33259,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call /*else*/ { __pyx_v_missing = 1; - /* "constraint/constraints.py":1135 + /* "constraint/constraints.py":1257 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< * missing_lt1.append(variable) * if isinstance(prod, float): */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1135, __pyx_L1_error) - if (__pyx_t_10) { + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_contains_lt1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1257, __pyx_L1_error) + if (__pyx_t_4) { - /* "constraint/constraints.py":1136 + /* "constraint/constraints.py":1258 * missing = True * if contains_lt1: * missing_lt1.append(variable) # <<<<<<<<<<<<<< * if isinstance(prod, float): * prod = round(prod, 10) */ - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1136, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_missing_lt1, __pyx_v_variable); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1258, __pyx_L1_error) - /* "constraint/constraints.py":1135 + /* "constraint/constraints.py":1257 * else: * missing = True * if contains_lt1: # <<<<<<<<<<<<<< @@ -31758,51 +33287,48 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } } - __pyx_L7:; + __pyx_L11:; - /* "constraint/constraints.py":1130 - * missing = False - * missing_lt1 = [] + /* "constraint/constraints.py":1252 + * for variable in variables: + * self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) * for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): # <<<<<<<<<<<<<< * if variable in assignments: * prod *= assignments[variable] */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1137 + /* "constraint/constraints.py":1259 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: */ - __pyx_t_10 = PyFloat_Check(__pyx_v_prod); - if (__pyx_t_10) { + __pyx_t_4 = PyFloat_Check(__pyx_v_prod); + if (__pyx_t_4) { - /* "constraint/constraints.py":1138 + /* "constraint/constraints.py":1260 * missing_lt1.append(variable) * if isinstance(prod, float): * prod = round(prod, 10) # <<<<<<<<<<<<<< * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False */ - __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_round); - __pyx_t_1 = __pyx_builtin_round; - __pyx_t_5 = 1; + __pyx_t_8 = NULL; + __pyx_t_10 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_prod, __pyx_mstate_global->__pyx_int_10}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_prod, __pyx_mstate_global->__pyx_int_10}; + __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_round, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); } - __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_6); + __pyx_t_6 = 0; - /* "constraint/constraints.py":1137 + /* "constraint/constraints.py":1259 * if contains_lt1: * missing_lt1.append(variable) * if isinstance(prod, float): # <<<<<<<<<<<<<< @@ -31811,34 +33337,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1139 + /* "constraint/constraints.py":1261 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< * return False * if forwardcheck: */ - __pyx_t_12 = (!__pyx_v_missing); - if (!__pyx_t_12) { + __pyx_t_13 = (!__pyx_v_missing); + if (!__pyx_t_13) { } else { - goto __pyx_L13_next_and; + goto __pyx_L17_next_and; } - __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1139, __pyx_L1_error) - __pyx_t_12 = (__pyx_t_6 == 0); - if (__pyx_t_12) { + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1261, __pyx_L1_error) + __pyx_t_13 = (__pyx_t_3 == 0); + if (__pyx_t_13) { } else { - __pyx_t_10 = __pyx_t_12; - goto __pyx_L12_bool_binop_done; + __pyx_t_4 = __pyx_t_13; + goto __pyx_L16_bool_binop_done; } - __pyx_L13_next_and:; - __pyx_t_3 = PyObject_RichCompare(__pyx_v_prod, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1139, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1139, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_10 = __pyx_t_12; - __pyx_L12_bool_binop_done:; - if (__pyx_t_10) { + __pyx_L17_next_and:; + __pyx_t_6 = PyObject_RichCompare(__pyx_v_prod, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1261, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __pyx_t_13; + __pyx_L16_bool_binop_done:; + if (__pyx_t_4) { - /* "constraint/constraints.py":1140 + /* "constraint/constraints.py":1262 * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False # <<<<<<<<<<<<<< @@ -31850,7 +33376,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1139 + /* "constraint/constraints.py":1261 * if isinstance(prod, float): * prod = round(prod, 10) * if (not missing or len(missing_lt1) == 0) and prod > maxprod: # <<<<<<<<<<<<<< @@ -31859,17 +33385,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1141 + /* "constraint/constraints.py":1263 * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1141, __pyx_L1_error) - if (__pyx_t_10) { + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1263, __pyx_L1_error) + if (__pyx_t_4) { - /* "constraint/constraints.py":1142 + /* "constraint/constraints.py":1264 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -31877,191 +33403,191 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * domain = domains[variable] */ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_3 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_3); - __pyx_t_6 = 0; - __pyx_t_7 = NULL; + __pyx_t_6 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_6); + __pyx_t_3 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1142, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1264, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_6))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1142, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1264, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_6); - ++__pyx_t_6; + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_3; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1142, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1264, __pyx_L1_error) #endif - if (__pyx_t_6 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_3)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_6); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_3); #endif - ++__pyx_t_6; + ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1142, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1264, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { + __pyx_t_8 = __pyx_t_5(__pyx_t_6); + if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1142, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1264, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":1143 + /* "constraint/constraints.py":1265 * if forwardcheck: * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: */ - __pyx_t_12 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error) - if (__pyx_t_12) { + __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error) + if (__pyx_t_13) { } else { - __pyx_t_10 = __pyx_t_12; - goto __pyx_L19_bool_binop_done; + __pyx_t_4 = __pyx_t_13; + goto __pyx_L23_bool_binop_done; } - __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1143, __pyx_L1_error) - if (!__pyx_t_12) { + __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_v_missing_lt1, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error) + if (!__pyx_t_13) { } else { - __pyx_t_10 = __pyx_t_12; - goto __pyx_L19_bool_binop_done; + __pyx_t_4 = __pyx_t_13; + goto __pyx_L23_bool_binop_done; } - __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1143, __pyx_L1_error) - __pyx_t_12 = (__pyx_t_13 == 1); - __pyx_t_10 = __pyx_t_12; - __pyx_L19_bool_binop_done:; - if (__pyx_t_10) { + __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_v_missing_lt1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_13 = (__pyx_t_2 == 1); + __pyx_t_4 = __pyx_t_13; + __pyx_L23_bool_binop_done:; + if (__pyx_t_4) { - /* "constraint/constraints.py":1144 + /* "constraint/constraints.py":1266 * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if prod * value > maxprod: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":1145 + /* "constraint/constraints.py":1267 * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if prod * value > maxprod: * domain.hideValue(value) */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); - __pyx_t_13 = 0; + __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { + __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1145, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1145, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1267, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1145, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1267, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); - ++__pyx_t_13; + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_2; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1145, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1267, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13)); + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); #endif - ++__pyx_t_13; + ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1145, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1267, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { + __pyx_t_8 = __pyx_t_14(__pyx_t_1); + if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1145, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1267, __pyx_L1_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/constraints.py":1146 + /* "constraint/constraints.py":1268 * domain = domains[variable] * for value in domain[:]: * if prod * value > maxprod: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1146, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1146, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_10) { + __pyx_t_8 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1268, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1268, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_4) { - /* "constraint/constraints.py":1147 + /* "constraint/constraints.py":1269 * for value in domain[:]: * if prod * value > maxprod: * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False */ - __pyx_t_1 = __pyx_v_domain; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = 0; + __pyx_t_8 = __pyx_v_domain; + __Pyx_INCREF(__pyx_t_8); + __pyx_t_10 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1147, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_value}; + __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1269, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1146 + /* "constraint/constraints.py":1268 * domain = domains[variable] * for value in domain[:]: * if prod * value > maxprod: # <<<<<<<<<<<<<< @@ -32070,7 +33596,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1145 + /* "constraint/constraints.py":1267 * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -32078,20 +33604,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * domain.hideValue(value) */ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1148 + /* "constraint/constraints.py":1270 * if prod * value > maxprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * return True */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1148, __pyx_L1_error) - __pyx_t_12 = (!__pyx_t_10); - if (__pyx_t_12) { + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1270, __pyx_L1_error) + __pyx_t_13 = (!__pyx_t_4); + if (__pyx_t_13) { - /* "constraint/constraints.py":1149 + /* "constraint/constraints.py":1271 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -32101,10 +33627,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1148 + /* "constraint/constraints.py":1270 * if prod * value > maxprod: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -32113,7 +33639,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1143 + /* "constraint/constraints.py":1265 * if forwardcheck: * for variable in variables: * if variable not in assignments and (variable not in missing_lt1 or len(missing_lt1) == 1): # <<<<<<<<<<<<<< @@ -32122,7 +33648,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1142 + /* "constraint/constraints.py":1264 * return False * if forwardcheck: * for variable in variables: # <<<<<<<<<<<<<< @@ -32130,9 +33656,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * domain = domains[variable] */ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1141 + /* "constraint/constraints.py":1263 * if (not missing or len(missing_lt1) == 0) and prod > maxprod: * return False * if forwardcheck: # <<<<<<<<<<<<<< @@ -32141,7 +33667,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call */ } - /* "constraint/constraints.py":1150 + /* "constraint/constraints.py":1272 * if not domain: * return False * return True # <<<<<<<<<<<<<< @@ -32153,7 +33679,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1125 + /* "constraint/constraints.py":1243 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -32164,10 +33690,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("constraint.constraints.MaxProdConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -32178,12 +33704,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call __Pyx_XDECREF(__pyx_v_contains_lt1); __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_value); + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_17MaxProdConstraint_8__call___2generator13); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1164 +/* "constraint/constraints.py":1292 * """ # noqa: E501 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -32232,38 +33759,38 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_target_var,&__pyx_mstate_global->__pyx_n_u_product_vars,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1164, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1292, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1164, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1292, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1164, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1292, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1164, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1292, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 1164, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1292, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 1164, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 1292, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1164, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1292, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1164, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1292, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1164, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1292, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_target_var = ((PyObject*)values[1]); @@ -32271,7 +33798,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1164, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1292, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -32282,7 +33809,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 1164, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_var), (&PyUnicode_Type), 0, "target_var", 2))) __PYX_ERR(0, 1292, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_target_var, __pyx_v_product_vars); /* function exit code */ @@ -32310,25 +33837,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1165 + /* "constraint/constraints.py":1293 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 * self.target_var = target_var # <<<<<<<<<<<<<< * self.product_vars = product_vars * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < 0) __PYX_ERR(0, 1165, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_v_target_var) < (0)) __PYX_ERR(0, 1293, __pyx_L1_error) - /* "constraint/constraints.py":1166 + /* "constraint/constraints.py":1294 * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 * self.target_var = target_var * self.product_vars = product_vars # <<<<<<<<<<<<<< * * def _get_product_bounds(self, domain_dict, exclude_var=None): */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_v_product_vars) < 0) __PYX_ERR(0, 1166, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_v_product_vars) < (0)) __PYX_ERR(0, 1294, __pyx_L1_error) - /* "constraint/constraints.py":1164 + /* "constraint/constraints.py":1292 * """ # noqa: E501 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< @@ -32348,7 +33875,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1168 +/* "constraint/constraints.py":1296 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -32397,41 +33924,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domain_dict,&__pyx_mstate_global->__pyx_n_u_exclude_var,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1168, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1296, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1168, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1296, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1168, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1296, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1168, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1296, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_get_product_bounds", 0) < 0) __PYX_ERR(0, 1168, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_get_product_bounds", 0) < (0)) __PYX_ERR(0, 1296, __pyx_L3_error) if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 1168, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, i); __PYX_ERR(0, 1296, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1168, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1296, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1168, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1296, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1168, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1296, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -32443,7 +33970,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_get_product_bounds", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1296, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -32470,10 +33997,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint PyObject *__pyx_v_dom = NULL; PyObject *__pyx_v_candidates = NULL; PyObject *__pyx_v_products = NULL; - PyObject *__pyx_9genexpr38__pyx_v_p = NULL; - PyObject *__pyx_9genexpr39__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr39__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr40__pyx_v_p = NULL; + PyObject *__pyx_9genexpr43__pyx_v_p = NULL; + PyObject *__pyx_9genexpr44__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr44__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr45__pyx_v_p = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -32483,10 +34010,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - size_t __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - int __pyx_t_11; + size_t __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; @@ -32496,35 +34023,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_product_bounds", 0); - /* "constraint/constraints.py":1169 + /* "constraint/constraints.py":1297 * * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] # <<<<<<<<<<<<<< * for var in self.product_vars: * if var == exclude_var: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1170 + /* "constraint/constraints.py":1298 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< * if var == exclude_var: * continue */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1170, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1170, __pyx_L1_error) + __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1298, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -32533,17 +34060,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1298, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1170, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1298, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } @@ -32554,13 +34081,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1170, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1298, __pyx_L1_error) PyErr_Clear(); } break; @@ -32570,19 +34097,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1171 + /* "constraint/constraints.py":1299 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< * continue * dom = domain_dict[var] */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_var, __pyx_v_exclude_var, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1171, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_var, __pyx_v_exclude_var, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1172 + /* "constraint/constraints.py":1300 * for var in self.product_vars: * if var == exclude_var: * continue # <<<<<<<<<<<<<< @@ -32591,7 +34118,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1171 + /* "constraint/constraints.py":1299 * bounds = [] * for var in self.product_vars: * if var == exclude_var: # <<<<<<<<<<<<<< @@ -32600,30 +34127,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1173 + /* "constraint/constraints.py":1301 * if var == exclude_var: * continue * dom = domain_dict[var] # <<<<<<<<<<<<<< * if not dom: * continue */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domain_dict, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1174 + /* "constraint/constraints.py":1302 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< * continue * bounds.append((min(dom), max(dom))) */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dom); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_dom); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1302, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "constraint/constraints.py":1175 + /* "constraint/constraints.py":1303 * dom = domain_dict[var] * if not dom: * continue # <<<<<<<<<<<<<< @@ -32632,7 +34159,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ goto __pyx_L3_continue; - /* "constraint/constraints.py":1174 + /* "constraint/constraints.py":1302 * continue * dom = domain_dict[var] * if not dom: # <<<<<<<<<<<<<< @@ -32641,7 +34168,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1176 + /* "constraint/constraints.py":1304 * if not dom: * continue * bounds.append((min(dom), max(dom))) # <<<<<<<<<<<<<< @@ -32649,41 +34176,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * if not bounds: */ __pyx_t_7 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_8 = __pyx_builtin_min; - __pyx_t_9 = 1; + __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_dom}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_7 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_10 = __pyx_builtin_max; - __pyx_t_9 = 1; + __pyx_t_9 = NULL; + __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_dom}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_dom}; + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1304, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1176, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1176, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1304, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 1304, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_8 = 0; - __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 1176, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_bounds, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1304, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1170 + /* "constraint/constraints.py":1298 * def _get_product_bounds(self, domain_dict, exclude_var=None): * bounds = [] * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -32694,19 +34215,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1178 + /* "constraint/constraints.py":1306 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< * return 1, 1 * */ - __pyx_t_6 = (__Pyx_PyList_GET_SIZE(__pyx_v_bounds) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 1178, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_bounds); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_t_6 = (__pyx_temp != 0); + } + __pyx_t_5 = (!__pyx_t_6); if (__pyx_t_5) { - /* "constraint/constraints.py":1179 + /* "constraint/constraints.py":1307 * * if not bounds: * return 1, 1 # <<<<<<<<<<<<<< @@ -32718,7 +34243,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = __pyx_mstate_global->__pyx_tuple[0]; goto __pyx_L0; - /* "constraint/constraints.py":1178 + /* "constraint/constraints.py":1306 * bounds.append((min(dom), max(dom))) * * if not bounds: # <<<<<<<<<<<<<< @@ -32727,7 +34252,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1182 + /* "constraint/constraints.py":1310 * * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -32735,34 +34260,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * return min(products), max(products) */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1182, __pyx_L11_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1310, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1182, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1310, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_9); { /* enter inner scope */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1310, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1182, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1310, __pyx_L16_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_11 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1182, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_7); - if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { - PyObject* sequence = __pyx_t_7; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1310, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_11); + if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) { + PyObject* sequence = __pyx_t_11; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1182, __pyx_L16_error) + __PYX_ERR(0, 1310, __pyx_L16_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -32771,31 +34296,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_13); } else { - __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1182, __pyx_L16_error) + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1310, __pyx_L16_error) __Pyx_XGOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1182, __pyx_L16_error) + __pyx_t_13 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1310, __pyx_L16_error) __Pyx_XGOTREF(__pyx_t_13); } #else - __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1182, __pyx_L16_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1310, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1182, __pyx_L16_error) + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1310, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_13); #endif - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1182, __pyx_L16_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1310, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); index = 0; __pyx_t_12 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_12)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1182, __pyx_L16_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1310, __pyx_L16_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L20_unpacking_done; @@ -32803,107 +34328,107 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1182, __pyx_L16_error) + __PYX_ERR(0, 1310, __pyx_L16_error) __pyx_L20_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr39__pyx_v_lo, __pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_lo, __pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr39__pyx_v_hi, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1182, __pyx_L16_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_9genexpr39__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr39__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_9genexpr39__pyx_v_lo) != (0)) __PYX_ERR(0, 1182, __pyx_L16_error); - __Pyx_INCREF(__pyx_9genexpr39__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr39__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_9genexpr39__pyx_v_hi) != (0)) __PYX_ERR(0, 1182, __pyx_L16_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1182, __pyx_L16_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1310, __pyx_L16_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_INCREF(__pyx_9genexpr44__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr44__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_9genexpr44__pyx_v_lo) != (0)) __PYX_ERR(0, 1310, __pyx_L16_error); + __Pyx_INCREF(__pyx_9genexpr44__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr44__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_9genexpr44__pyx_v_hi) != (0)) __PYX_ERR(0, 1310, __pyx_L16_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 1310, __pyx_L16_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_hi); __pyx_9genexpr39__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_lo); __pyx_9genexpr39__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_hi); __pyx_9genexpr44__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_lo); __pyx_9genexpr44__pyx_v_lo = 0; goto __pyx_L22_exit_scope; __pyx_L16_error:; - __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_hi); __pyx_9genexpr39__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_lo); __pyx_9genexpr39__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_hi); __pyx_9genexpr44__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_lo); __pyx_9genexpr44__pyx_v_lo = 0; goto __pyx_L11_error; __pyx_L22_exit_scope:; } /* exit inner scope */ - __pyx_t_1 = PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L11_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1310, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1310, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { - __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { + __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L11_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1310, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L11_error) + __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1310, __pyx_L11_error) } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1182, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1310, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1182, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1310, __pyx_L11_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); + __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3)); #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); #endif ++__pyx_t_3; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1182, __pyx_L11_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1310, __pyx_L11_error) } else { - __pyx_t_8 = __pyx_t_4(__pyx_t_1); - if (unlikely(!__pyx_t_8)) { + __pyx_t_7 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1182, __pyx_L11_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1310, __pyx_L11_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr38__pyx_v_p, __pyx_t_8); - __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr38__pyx_v_p))) __PYX_ERR(0, 1182, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_p, __pyx_t_7); + __pyx_t_7 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr43__pyx_v_p))) __PYX_ERR(0, 1310, __pyx_L11_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_p); __pyx_9genexpr38__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_p); __pyx_9genexpr43__pyx_v_p = 0; goto __pyx_L24_exit_scope; __pyx_L11_error:; - __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_p); __pyx_9genexpr38__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_p); __pyx_9genexpr43__pyx_v_p = 0; goto __pyx_L1_error; __pyx_L24_exit_scope:; } /* exit inner scope */ __pyx_v_candidates = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1183 + /* "constraint/constraints.py":1311 * # Try all corner combinations * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] * products = [self._safe_product(p) for p in candidates] # <<<<<<<<<<<<<< @@ -32911,7 +34436,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1183, __pyx_L27_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; @@ -32919,41 +34444,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1183, __pyx_L27_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1311, __pyx_L27_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1183, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_9genexpr40__pyx_v_p, __pyx_t_8); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1311, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_p, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_9 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_9); __pyx_t_8 = 0; - __pyx_t_10 = __pyx_v_self; - __Pyx_INCREF(__pyx_t_10); - __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr40__pyx_v_p}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1183, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_9genexpr45__pyx_v_p}; + __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1311, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_7); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1183, __pyx_L27_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 1311, __pyx_L27_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_p); __pyx_9genexpr40__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_p); __pyx_9genexpr45__pyx_v_p = 0; goto __pyx_L31_exit_scope; __pyx_L27_error:; - __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_p); __pyx_9genexpr40__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_p); __pyx_9genexpr45__pyx_v_p = 0; goto __pyx_L1_error; __pyx_L31_exit_scope:; } /* exit inner scope */ __pyx_v_products = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1184 + /* "constraint/constraints.py":1312 * candidates = [p for p in product(*[(lo, hi) for lo, hi in bounds])] * products = [self._safe_product(p) for p in candidates] * return min(products), max(products) # <<<<<<<<<<<<<< @@ -32962,42 +34487,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_8 = __pyx_builtin_min; - __pyx_t_9 = 1; + __pyx_t_8 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1184, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_10 = __pyx_builtin_max; - __pyx_t_9 = 1; + __pyx_t_7 = NULL; + __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_products}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_products}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1312, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1184, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 1184, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1312, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 1312, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_8 = 0; - __pyx_r = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_t_1 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1168 + /* "constraint/constraints.py":1296 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< @@ -33010,8 +34529,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); @@ -33023,16 +34542,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF(__pyx_v_dom); __Pyx_XDECREF(__pyx_v_candidates); __Pyx_XDECREF(__pyx_v_products); - __Pyx_XDECREF(__pyx_9genexpr38__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr39__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr40__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_p); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/constraints.py":1186 +/* "constraint/constraints.py":1314 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -33080,39 +34599,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_values,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1186, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1314, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1186, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1314, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1186, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1314, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_safe_product", 0) < 0) __PYX_ERR(0, 1186, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_safe_product", 0) < (0)) __PYX_ERR(0, 1314, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 1186, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, i); __PYX_ERR(0, 1314, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1186, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1314, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1186, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1314, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_values = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1186, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_safe_product", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1314, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33147,7 +34666,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_safe_product", 0); - /* "constraint/constraints.py":1187 + /* "constraint/constraints.py":1315 * * def _safe_product(self, values): * prod = 1 # <<<<<<<<<<<<<< @@ -33157,7 +34676,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; - /* "constraint/constraints.py":1188 + /* "constraint/constraints.py":1316 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -33169,9 +34688,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1188, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1188, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -33179,17 +34698,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1316, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1316, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -33200,13 +34719,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1188, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1316, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1188, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1316, __pyx_L1_error) PyErr_Clear(); } break; @@ -33216,19 +34735,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1189 + /* "constraint/constraints.py":1317 * prod = 1 * for v in values: * prod *= v # <<<<<<<<<<<<<< * return prod * */ - __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_prod, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1188 + /* "constraint/constraints.py":1316 * def _safe_product(self, values): * prod = 1 * for v in values: # <<<<<<<<<<<<<< @@ -33238,7 +34757,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1190 + /* "constraint/constraints.py":1318 * for v in values: * prod *= v * return prod # <<<<<<<<<<<<<< @@ -33250,7 +34769,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = __pyx_v_prod; goto __pyx_L0; - /* "constraint/constraints.py":1186 + /* "constraint/constraints.py":1314 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< @@ -33272,7 +34791,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1192 +/* "constraint/constraints.py":1320 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -33323,50 +34842,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1192, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1320, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1192, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1320, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1192, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1320, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1192, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1320, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1192, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1320, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1192, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1320, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 1192, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 1320, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1192, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1320, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1192, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1320, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1192, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1320, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1192, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1320, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1192, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1320, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1192, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1320, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -33376,7 +34895,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1192, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1320, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33387,9 +34906,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1192, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1192, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1192, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1320, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1320, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1320, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_6preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -33437,7 +34956,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1193 + /* "constraint/constraints.py":1321 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -33445,9 +34964,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * t_max = max(target_dom) */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1193, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1193, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 1; @@ -33464,30 +34983,30 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1194 + /* "constraint/constraints.py":1322 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] # <<<<<<<<<<<<<< * t_max = max(target_dom) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_target_dom = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":1195 + /* "constraint/constraints.py":1323 * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] * t_max = max(target_dom) # <<<<<<<<<<<<<< @@ -33495,73 +35014,70 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * for var in self.product_vars: */ __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_2 = __pyx_builtin_max; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_target_dom}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1195, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_t_max = __pyx_t_4; __pyx_t_4 = 0; - /* "constraint/constraints.py":1197 + /* "constraint/constraints.py":1325 * t_max = max(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1197, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1197, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1325, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1197, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1325, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1197, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1325, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1197, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1325, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_7(__pyx_t_2); + __pyx_t_4 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1197, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1325, __pyx_L1_error) PyErr_Clear(); } break; @@ -33571,25 +35087,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1198 + /* "constraint/constraints.py":1326 * * for var in self.product_vars: * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) # <<<<<<<<<<<<<< * dom = domains[var] * for val in dom[:]: */ - __pyx_t_1 = __pyx_v_self; - __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_1, __pyx_v_domains}; - __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error) + PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_v_domains}; + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_exclude_var, __pyx_v_var, __pyx_t_3, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1198, __pyx_L1_error) - __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_exclude_var, __pyx_v_var, __pyx_t_3, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 1326, __pyx_L1_error) + __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { @@ -33598,40 +35114,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1198, __pyx_L1_error) + __PYX_ERR(0, 1326, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1198, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1198, __pyx_L1_error) + index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < (0)) __PYX_ERR(0, 1326, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -33639,79 +35155,79 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1198, __pyx_L1_error) + __PYX_ERR(0, 1326, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_min_others, __pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_max_others, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_max_others, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/constraints.py":1199 + /* "constraint/constraints.py":1327 * for var in self.product_vars: * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] # <<<<<<<<<<<<<< * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1199, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_dom, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1200 + /* "constraint/constraints.py":1328 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: */ - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_dom, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_dom, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1200, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1328, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1200, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1328, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_10); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_10; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1200, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1328, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10)); + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10)); #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); #endif ++__pyx_t_10; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1328, __pyx_L1_error) } else { - __pyx_t_4 = __pyx_t_11(__pyx_t_1); + __pyx_t_4 = __pyx_t_11(__pyx_t_2); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1200, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1328, __pyx_L1_error) PyErr_Clear(); } break; @@ -33721,29 +35237,29 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1201 + /* "constraint/constraints.py":1329 * dom = domains[var] * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] # <<<<<<<<<<<<<< * if min(possible_prods) > t_max: * dom.remove(val) */ - __pyx_t_4 = PyNumber_Multiply(__pyx_v_val, __pyx_v_min_others); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_v_val, __pyx_v_min_others); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_val, __pyx_v_max_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_val, __pyx_v_max_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1201, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 1329, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1201, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1329, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_possible_prods, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; - /* "constraint/constraints.py":1202 + /* "constraint/constraints.py":1330 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< @@ -33751,24 +35267,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * */ __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_4 = __pyx_builtin_min; __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_possible_prods}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1202, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_v_t_max, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1202, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_8, __pyx_v_t_max, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1202, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1330, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_12) { - /* "constraint/constraints.py":1203 + /* "constraint/constraints.py":1331 * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: * dom.remove(val) # <<<<<<<<<<<<<< @@ -33780,14 +35293,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_val}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1202 + /* "constraint/constraints.py":1330 * for val in dom[:]: * possible_prods = [val * min_others, val * max_others] * if min(possible_prods) > t_max: # <<<<<<<<<<<<<< @@ -33796,7 +35309,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1200 + /* "constraint/constraints.py":1328 * min_others, max_others = self._get_product_bounds(domains, exclude_var=var) * dom = domains[var] * for val in dom[:]: # <<<<<<<<<<<<<< @@ -33804,9 +35317,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * if min(possible_prods) > t_max: */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1197 + /* "constraint/constraints.py":1325 * t_max = max(target_dom) * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -33814,9 +35327,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * dom = domains[var] */ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1192 + /* "constraint/constraints.py":1320 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -33849,7 +35362,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1205 +/* "constraint/constraints.py":1333 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -33900,53 +35413,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1205, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1333, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1333, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1333, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1333, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1333, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1333, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 1205, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 1333, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1205, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1333, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1333, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1333, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1333, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1333, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1205, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1333, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -33960,7 +35473,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1205, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1333, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33971,8 +35484,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1205, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1205, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1333, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1333, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_8__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -33993,7 +35506,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/constraints.py":1241 +/* "constraint/constraints.py":1369 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): # <<<<<<<<<<<<<< @@ -34013,7 +35526,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1241, __pyx_L1_error) + __PYX_ERR(0, 1369, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -34024,7 +35537,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator14, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint___call, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1241, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator14, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint___call, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1369, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -34061,29 +35574,29 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1241, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1241, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1369, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1369, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1241, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1369, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value)) { __Pyx_RaiseClosureNameError("target_value"); __PYX_ERR(0, 1241, __pyx_L1_error) } - __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_p, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1241, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value)) { __Pyx_RaiseClosureNameError("target_value"); __PYX_ERR(0, 1369, __pyx_L1_error) } + __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_p, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1369, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1369, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = (!__pyx_t_4); if (__pyx_t_5) { @@ -34123,7 +35636,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1205 +/* "constraint/constraints.py":1333 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -34145,17 +35658,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint PyObject *__pyx_v_domain = NULL; PyObject *__pyx_v_val = NULL; PyObject *__pyx_v_prods = NULL; - PyObject *__pyx_9genexpr41__pyx_v_v = NULL; - PyObject *__pyx_9genexpr42__pyx_v_p = NULL; - PyObject *__pyx_9genexpr43__pyx_v_lo = NULL; - PyObject *__pyx_9genexpr43__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr44__pyx_v_c = NULL; - PyObject *__pyx_9genexpr45__pyx_v_v = NULL; PyObject *__pyx_9genexpr46__pyx_v_v = NULL; PyObject *__pyx_9genexpr47__pyx_v_p = NULL; PyObject *__pyx_9genexpr48__pyx_v_lo = NULL; PyObject *__pyx_9genexpr48__pyx_v_hi = NULL; - PyObject *__pyx_9genexpr49__pyx_v_o = NULL; + PyObject *__pyx_9genexpr49__pyx_v_c = NULL; + PyObject *__pyx_9genexpr50__pyx_v_v = NULL; + PyObject *__pyx_9genexpr51__pyx_v_v = NULL; + PyObject *__pyx_9genexpr52__pyx_v_p = NULL; + PyObject *__pyx_9genexpr53__pyx_v_lo = NULL; + PyObject *__pyx_9genexpr53__pyx_v_hi = NULL; + PyObject *__pyx_9genexpr54__pyx_v_o = NULL; PyObject *__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator14 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -34169,8 +35682,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - size_t __pyx_t_12; + size_t __pyx_t_11; + PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *(*__pyx_t_15)(PyObject *); @@ -34185,25 +35698,25 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1205, __pyx_L1_error) + __PYX_ERR(0, 1333, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/constraints.py":1206 + /* "constraint/constraints.py":1334 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< * return True # Can't evaluate yet * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/constraints.py":1207 + /* "constraint/constraints.py":1335 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: * return True # Can't evaluate yet # <<<<<<<<<<<<<< @@ -34215,7 +35728,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1206 + /* "constraint/constraints.py":1334 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * if self.target_var not in assignments: # <<<<<<<<<<<<<< @@ -34224,23 +35737,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1209 + /* "constraint/constraints.py":1337 * return True # Can't evaluate yet * * target_value = assignments[self.target_var] # <<<<<<<<<<<<<< * assigned_prod = 1 * unassigned = [] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1209, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_target_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1209, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_3); __pyx_cur_scope->__pyx_v_target_value = __pyx_t_3; __pyx_t_3 = 0; - /* "constraint/constraints.py":1210 + /* "constraint/constraints.py":1338 * * target_value = assignments[self.target_var] * assigned_prod = 1 # <<<<<<<<<<<<<< @@ -34250,35 +35763,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __pyx_v_assigned_prod = __pyx_mstate_global->__pyx_int_1; - /* "constraint/constraints.py":1211 + /* "constraint/constraints.py":1339 * target_value = assignments[self.target_var] * assigned_prod = 1 * unassigned = [] # <<<<<<<<<<<<<< * * for var in self.product_vars: */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_unassigned = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1213 + /* "constraint/constraints.py":1341 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< * if var in assignments: * assigned_prod *= assignments[var] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_product_vars); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1213, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1341, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -34287,17 +35800,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1213, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1341, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1213, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1341, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } @@ -34308,13 +35821,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1213, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1341, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1213, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1341, __pyx_L1_error) PyErr_Clear(); } break; @@ -34324,32 +35837,32 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":1214 + /* "constraint/constraints.py":1342 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< * assigned_prod *= assignments[var] * else: */ - __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1214, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_var, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1342, __pyx_L1_error) if (__pyx_t_2) { - /* "constraint/constraints.py":1215 + /* "constraint/constraints.py":1343 * for var in self.product_vars: * if var in assignments: * assigned_prod *= assignments[var] # <<<<<<<<<<<<<< * else: * unassigned.append(var) */ - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1215, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_assigned_prod, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1215, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_assigned_prod, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_assigned_prod, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1214 + /* "constraint/constraints.py":1342 * * for var in self.product_vars: * if var in assignments: # <<<<<<<<<<<<<< @@ -34359,7 +35872,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L6; } - /* "constraint/constraints.py":1217 + /* "constraint/constraints.py":1345 * assigned_prod *= assignments[var] * else: * unassigned.append(var) # <<<<<<<<<<<<<< @@ -34367,11 +35880,11 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * if not unassigned: */ /*else*/ { - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_unassigned, __pyx_v_var); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1217, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_unassigned, __pyx_v_var); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1345, __pyx_L1_error) } __pyx_L6:; - /* "constraint/constraints.py":1213 + /* "constraint/constraints.py":1341 * unassigned = [] * * for var in self.product_vars: # <<<<<<<<<<<<<< @@ -34381,19 +35894,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1219 + /* "constraint/constraints.py":1347 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< * return assigned_prod <= target_value * */ - __pyx_t_2 = (__Pyx_PyList_GET_SIZE(__pyx_v_unassigned) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 1219, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_unassigned); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_2 = (__pyx_temp != 0); + } + __pyx_t_8 = (!__pyx_t_2); if (__pyx_t_8) { - /* "constraint/constraints.py":1220 + /* "constraint/constraints.py":1348 * * if not unassigned: * return assigned_prod <= target_value # <<<<<<<<<<<<<< @@ -34401,12 +35918,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * # Estimate max possible value of full product */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_assigned_prod, __pyx_cur_scope->__pyx_v_target_value, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1220, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_assigned_prod, __pyx_cur_scope->__pyx_v_target_value, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L1_error) __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1219 + /* "constraint/constraints.py":1347 * unassigned.append(var) * * if not unassigned: # <<<<<<<<<<<<<< @@ -34415,7 +35932,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1223 + /* "constraint/constraints.py":1351 * * # Estimate max possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] # <<<<<<<<<<<<<< @@ -34423,7 +35940,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * possible_prods = [assigned_prod * c for c in candidates] */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L11_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; @@ -34431,69 +35948,63 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1223, __pyx_L11_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1351, __pyx_L11_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1223, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr41__pyx_v_v, __pyx_t_3); + __Pyx_XDECREF_SET(__pyx_9genexpr46__pyx_v_v, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_10 = __pyx_builtin_min; - __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr41__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1223, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = 1; + __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr46__pyx_v_v); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1351, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_11}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1223, __pyx_L11_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_11 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_9 = __pyx_builtin_max; - __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr41__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1223, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = 1; + __pyx_t_9 = NULL; + __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr46__pyx_v_v); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1351, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_11 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_13}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1223, __pyx_L11_error) + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_12}; + __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1351, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1223, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1351, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1223, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1351, __pyx_L11_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1223, __pyx_L11_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10) != (0)) __PYX_ERR(0, 1351, __pyx_L11_error); __pyx_t_3 = 0; __pyx_t_10 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1223, __pyx_L11_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1351, __pyx_L11_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_v); __pyx_9genexpr41__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_v); __pyx_9genexpr46__pyx_v_v = 0; goto __pyx_L15_exit_scope; __pyx_L11_error:; - __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_v); __pyx_9genexpr41__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_v); __pyx_9genexpr46__pyx_v_v = 0; goto __pyx_L1_error; __pyx_L15_exit_scope:; } /* exit inner scope */ __pyx_v_domain_bounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1224 + /* "constraint/constraints.py":1352 * # Estimate max possible value of full product * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] # <<<<<<<<<<<<<< @@ -34501,26 +36012,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * if min(possible_prods) > target_value: */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L18_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1224, __pyx_L18_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1352, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_6); { /* enter inner scope */ - __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1224, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1352, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __pyx_v_domain_bounds; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1224, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1352, __pyx_L23_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L23_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1352, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; @@ -34528,40 +36039,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1224, __pyx_L23_error) + __PYX_ERR(0, 1352, __pyx_L23_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_9); + __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_13); - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_11); } else { - __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1224, __pyx_L23_error) + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1352, __pyx_L23_error) + __Pyx_XGOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1352, __pyx_L23_error) __Pyx_XGOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1224, __pyx_L23_error) - __Pyx_XGOTREF(__pyx_t_11); } #else - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1224, __pyx_L23_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1352, __pyx_L23_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1352, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1224, __pyx_L23_error) - __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1224, __pyx_L23_error) + __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1352, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); - index = 0; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L26_unpacking_failed; + index = 0; __pyx_t_9 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_9)) goto __pyx_L26_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L26_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); - index = 1; __pyx_t_11 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_11)) goto __pyx_L26_unpacking_failed; - __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1224, __pyx_L23_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 1352, __pyx_L23_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L27_unpacking_done; @@ -34569,118 +36080,118 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1224, __pyx_L23_error) + __PYX_ERR(0, 1352, __pyx_L23_error) __pyx_L27_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_lo, __pyx_t_13); + __Pyx_XDECREF_SET(__pyx_9genexpr48__pyx_v_lo, __pyx_t_9); + __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr48__pyx_v_hi, __pyx_t_13); __pyx_t_13 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_hi, __pyx_t_11); - __pyx_t_11 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L23_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1352, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_9genexpr43__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr43__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_9genexpr43__pyx_v_lo) != (0)) __PYX_ERR(0, 1224, __pyx_L23_error); - __Pyx_INCREF(__pyx_9genexpr43__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr43__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr43__pyx_v_hi) != (0)) __PYX_ERR(0, 1224, __pyx_L23_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1224, __pyx_L23_error) + __Pyx_INCREF(__pyx_9genexpr48__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr48__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_9genexpr48__pyx_v_lo) != (0)) __PYX_ERR(0, 1352, __pyx_L23_error); + __Pyx_INCREF(__pyx_9genexpr48__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr48__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_9genexpr48__pyx_v_hi) != (0)) __PYX_ERR(0, 1352, __pyx_L23_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1352, __pyx_L23_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_hi); __pyx_9genexpr43__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_lo); __pyx_9genexpr43__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_hi); __pyx_9genexpr48__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_lo); __pyx_9genexpr48__pyx_v_lo = 0; goto __pyx_L29_exit_scope; __pyx_L23_error:; - __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_hi); __pyx_9genexpr43__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_lo); __pyx_9genexpr43__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_hi); __pyx_9genexpr48__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_lo); __pyx_9genexpr48__pyx_v_lo = 0; goto __pyx_L18_error; __pyx_L29_exit_scope:; } /* exit inner scope */ - __pyx_t_10 = PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1224, __pyx_L18_error) + __pyx_t_10 = PySequence_Tuple(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1352, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1224, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1352, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { - __pyx_t_10 = __pyx_t_9; __Pyx_INCREF(__pyx_t_10); + if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) { + __pyx_t_10 = __pyx_t_12; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1224, __pyx_L18_error) + __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1352, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1224, __pyx_L18_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1352, __pyx_L18_error) } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_10))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1224, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1352, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_4); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1224, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1352, __pyx_L18_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4)); + __pyx_t_12 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4)); #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); + __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); #endif ++__pyx_t_4; } - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1224, __pyx_L18_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1352, __pyx_L18_error) } else { - __pyx_t_9 = __pyx_t_5(__pyx_t_10); - if (unlikely(!__pyx_t_9)) { + __pyx_t_12 = __pyx_t_5(__pyx_t_10); + if (unlikely(!__pyx_t_12)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1224, __pyx_L18_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1352, __pyx_L18_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr42__pyx_v_p, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_GOTREF(__pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr47__pyx_v_p, __pyx_t_12); + __pyx_t_12 = 0; __pyx_t_6 = __pyx_v_self; __Pyx_INCREF(__pyx_t_6); - __pyx_t_12 = 0; + __pyx_t_11 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr42__pyx_v_p}; - __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_9genexpr47__pyx_v_p}; + __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1224, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_9); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1352, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_12); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1224, __pyx_L18_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1352, __pyx_L18_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_p); __pyx_9genexpr42__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_p); __pyx_9genexpr47__pyx_v_p = 0; goto __pyx_L31_exit_scope; __pyx_L18_error:; - __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_p); __pyx_9genexpr42__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_p); __pyx_9genexpr47__pyx_v_p = 0; goto __pyx_L1_error; __pyx_L31_exit_scope:; } /* exit inner scope */ __pyx_v_candidates = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1225 + /* "constraint/constraints.py":1353 * domain_bounds = [(min(domains[v]), max(domains[v])) for v in unassigned] * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] * possible_prods = [assigned_prod * c for c in candidates] # <<<<<<<<<<<<<< @@ -34688,7 +36199,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * return False */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L34_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L34_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __pyx_v_candidates; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -34696,33 +36207,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1225, __pyx_L34_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1353, __pyx_L34_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_4); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1225, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_c, __pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_9genexpr44__pyx_v_c); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1225, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1225, __pyx_L34_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1353, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr49__pyx_v_c, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_9genexpr49__pyx_v_c); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1353, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_12); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1353, __pyx_L34_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_c); __pyx_9genexpr44__pyx_v_c = 0; + __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_c); __pyx_9genexpr49__pyx_v_c = 0; goto __pyx_L38_exit_scope; __pyx_L34_error:; - __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_c); __pyx_9genexpr44__pyx_v_c = 0; + __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_c); __pyx_9genexpr49__pyx_v_c = 0; goto __pyx_L1_error; __pyx_L38_exit_scope:; } /* exit inner scope */ __pyx_v_possible_prods = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1226 + /* "constraint/constraints.py":1354 * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] * possible_prods = [assigned_prod * c for c in candidates] * if min(possible_prods) > target_value: # <<<<<<<<<<<<<< @@ -34730,24 +36241,21 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * */ __pyx_t_10 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_9 = __pyx_builtin_min; - __pyx_t_12 = 1; + __pyx_t_11 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_possible_prods}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_cur_scope->__pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1226, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_cur_scope->__pyx_v_target_value, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1354, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1226, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1354, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1227 + /* "constraint/constraints.py":1355 * possible_prods = [assigned_prod * c for c in candidates] * if min(possible_prods) > target_value: * return False # <<<<<<<<<<<<<< @@ -34759,7 +36267,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1226 + /* "constraint/constraints.py":1354 * candidates = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in domain_bounds])] * possible_prods = [assigned_prod * c for c in candidates] * if min(possible_prods) > target_value: # <<<<<<<<<<<<<< @@ -34768,41 +36276,41 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1229 + /* "constraint/constraints.py":1357 * return False * * if forwardcheck: # <<<<<<<<<<<<<< * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1229, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1357, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1230 + /* "constraint/constraints.py":1358 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: */ - __pyx_t_9 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_9); + __pyx_t_10 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1358, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_4); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1231 + /* "constraint/constraints.py":1359 * if forwardcheck: * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] # <<<<<<<<<<<<<< @@ -34810,54 +36318,58 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * bounds = [(min(domains[v]), max(domains[v])) for v in other_unassigned] */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L45_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_10); + __pyx_t_12 = __pyx_v_unassigned; __Pyx_INCREF(__pyx_t_12); __pyx_t_16 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1231, __pyx_L45_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1359, __pyx_L45_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_16); + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1231, __pyx_L45_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1359, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_v, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr50__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_9genexpr45__pyx_v_v, __pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1231, __pyx_L45_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1231, __pyx_L45_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_9genexpr50__pyx_v_v, __pyx_v_var, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1359, __pyx_L45_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1359, __pyx_L45_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_8) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr45__pyx_v_v))) __PYX_ERR(0, 1231, __pyx_L45_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_9genexpr50__pyx_v_v))) __PYX_ERR(0, 1359, __pyx_L45_error) } } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_v); __pyx_9genexpr45__pyx_v_v = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_v); __pyx_9genexpr50__pyx_v_v = 0; goto __pyx_L50_exit_scope; __pyx_L45_error:; - __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_v); __pyx_9genexpr45__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_v); __pyx_9genexpr50__pyx_v_v = 0; goto __pyx_L1_error; __pyx_L50_exit_scope:; } /* exit inner scope */ __Pyx_XDECREF_SET(__pyx_v_other_unassigned, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1232 + /* "constraint/constraints.py":1360 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< * bounds = [(min(domains[v]), max(domains[v])) for v in other_unassigned] * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] */ - __pyx_t_8 = (__Pyx_PyList_GET_SIZE(__pyx_v_other_unassigned) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_8 < 0))) __PYX_ERR(0, 1232, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_other_unassigned); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 1360, __pyx_L1_error) + __pyx_t_8 = (__pyx_temp != 0); + } + if (__pyx_t_8) { - /* "constraint/constraints.py":1233 + /* "constraint/constraints.py":1361 * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: * bounds = [(min(domains[v]), max(domains[v])) for v in other_unassigned] # <<<<<<<<<<<<<< @@ -34865,77 +36377,71 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * else: */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L54_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __pyx_v_other_unassigned; __Pyx_INCREF(__pyx_t_10); + __pyx_t_12 = __pyx_v_other_unassigned; __Pyx_INCREF(__pyx_t_12); __pyx_t_16 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_12); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1233, __pyx_L54_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1361, __pyx_L54_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_16); + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_12, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1233, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1361, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr46__pyx_v_v, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr51__pyx_v_v, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_min); - __pyx_t_11 = __pyx_builtin_min; - __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr46__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1233, __pyx_L54_error) + __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr51__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1361, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = 1; + __pyx_t_11 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_13}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_min, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1233, __pyx_L54_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1361, __pyx_L54_error) __Pyx_GOTREF(__pyx_t_6); } - __pyx_t_13 = NULL; - __Pyx_INCREF(__pyx_builtin_max); - __pyx_t_3 = __pyx_builtin_max; - __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr46__pyx_v_v); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1233, __pyx_L54_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_12 = 1; + __pyx_t_3 = NULL; + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_9genexpr51__pyx_v_v); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1361, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1233, __pyx_L54_error) - __Pyx_GOTREF(__pyx_t_11); + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9}; + __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_max, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1361, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_13); } - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1233, __pyx_L54_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1361, __pyx_L54_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1233, __pyx_L54_error); - __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11) != (0)) __PYX_ERR(0, 1233, __pyx_L54_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 1361, __pyx_L54_error); + __Pyx_GIVEREF(__pyx_t_13); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_13) != (0)) __PYX_ERR(0, 1361, __pyx_L54_error); __pyx_t_6 = 0; - __pyx_t_11 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1233, __pyx_L54_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_13 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1361, __pyx_L54_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_v); __pyx_9genexpr46__pyx_v_v = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_v); __pyx_9genexpr51__pyx_v_v = 0; goto __pyx_L58_exit_scope; __pyx_L54_error:; - __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_v); __pyx_9genexpr46__pyx_v_v = 0; + __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_v); __pyx_9genexpr51__pyx_v_v = 0; goto __pyx_L1_error; __pyx_L58_exit_scope:; } /* exit inner scope */ __Pyx_XDECREF_SET(__pyx_v_bounds, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1234 + /* "constraint/constraints.py":1362 * if other_unassigned: * bounds = [(min(domains[v]), max(domains[v])) for v in other_unassigned] * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] # <<<<<<<<<<<<<< @@ -34943,26 +36449,26 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * other_products = [1] */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L61_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L61_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1234, __pyx_L61_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1362, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_12); { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L66_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_11); + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1362, __pyx_L66_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = __pyx_v_bounds; __Pyx_INCREF(__pyx_t_13); __pyx_t_16 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1234, __pyx_L66_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1362, __pyx_L66_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_11, __pyx_t_16); + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1234, __pyx_L66_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1362, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_6); if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; @@ -34970,40 +36476,40 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1234, __pyx_L66_error) + __PYX_ERR(0, 1362, __pyx_L66_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_14); - __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_13); } else { - __pyx_t_14 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1234, __pyx_L66_error) + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1362, __pyx_L66_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1362, __pyx_L66_error) __Pyx_XGOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1234, __pyx_L66_error) - __Pyx_XGOTREF(__pyx_t_13); } #else - __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1234, __pyx_L66_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1362, __pyx_L66_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1362, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1234, __pyx_L66_error) - __Pyx_GOTREF(__pyx_t_13); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; - __pyx_t_17 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1234, __pyx_L66_error) + __pyx_t_17 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1362, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_17); - index = 0; __pyx_t_14 = __pyx_t_15(__pyx_t_17); if (unlikely(!__pyx_t_14)) goto __pyx_L69_unpacking_failed; + index = 0; __pyx_t_3 = __pyx_t_15(__pyx_t_17); if (unlikely(!__pyx_t_3)) goto __pyx_L69_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_14 = __pyx_t_15(__pyx_t_17); if (unlikely(!__pyx_t_14)) goto __pyx_L69_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); - index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_17); if (unlikely(!__pyx_t_13)) goto __pyx_L69_unpacking_failed; - __Pyx_GOTREF(__pyx_t_13); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_17), 2) < 0) __PYX_ERR(0, 1234, __pyx_L66_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_17), 2) < (0)) __PYX_ERR(0, 1362, __pyx_L66_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; goto __pyx_L70_unpacking_done; @@ -35011,118 +36517,118 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; __pyx_t_15 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1234, __pyx_L66_error) + __PYX_ERR(0, 1362, __pyx_L66_error) __pyx_L70_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_9genexpr48__pyx_v_lo, __pyx_t_14); + __Pyx_XDECREF_SET(__pyx_9genexpr53__pyx_v_lo, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_9genexpr53__pyx_v_hi, __pyx_t_14); __pyx_t_14 = 0; - __Pyx_XDECREF_SET(__pyx_9genexpr48__pyx_v_hi, __pyx_t_13); - __pyx_t_13 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1234, __pyx_L66_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1362, __pyx_L66_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_9genexpr48__pyx_v_lo); - __Pyx_GIVEREF(__pyx_9genexpr48__pyx_v_lo); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr48__pyx_v_lo) != (0)) __PYX_ERR(0, 1234, __pyx_L66_error); - __Pyx_INCREF(__pyx_9genexpr48__pyx_v_hi); - __Pyx_GIVEREF(__pyx_9genexpr48__pyx_v_hi); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr48__pyx_v_hi) != (0)) __PYX_ERR(0, 1234, __pyx_L66_error); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1234, __pyx_L66_error) + __Pyx_INCREF(__pyx_9genexpr53__pyx_v_lo); + __Pyx_GIVEREF(__pyx_9genexpr53__pyx_v_lo); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_9genexpr53__pyx_v_lo) != (0)) __PYX_ERR(0, 1362, __pyx_L66_error); + __Pyx_INCREF(__pyx_9genexpr53__pyx_v_hi); + __Pyx_GIVEREF(__pyx_9genexpr53__pyx_v_hi); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_9genexpr53__pyx_v_hi) != (0)) __PYX_ERR(0, 1362, __pyx_L66_error); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1362, __pyx_L66_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_hi); __pyx_9genexpr48__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_lo); __pyx_9genexpr48__pyx_v_lo = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_hi); __pyx_9genexpr53__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_lo); __pyx_9genexpr53__pyx_v_lo = 0; goto __pyx_L72_exit_scope; __pyx_L66_error:; - __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_hi); __pyx_9genexpr48__pyx_v_hi = 0; - __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_lo); __pyx_9genexpr48__pyx_v_lo = 0; + __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_hi); __pyx_9genexpr53__pyx_v_hi = 0; + __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_lo); __pyx_9genexpr53__pyx_v_lo = 0; goto __pyx_L61_error; __pyx_L72_exit_scope:; } /* exit inner scope */ - __pyx_t_11 = PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1234, __pyx_L61_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L61_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_11 = __pyx_t_3; __Pyx_INCREF(__pyx_t_11); + __pyx_t_13 = PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1362, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1362, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_13 = __pyx_t_9; __Pyx_INCREF(__pyx_t_13); __pyx_t_16 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_16 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1234, __pyx_L61_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1234, __pyx_L61_error) + __pyx_t_16 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1362, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1362, __pyx_L61_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_11))) { + if (likely(PyList_CheckExact(__pyx_t_13))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1234, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1362, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_11, __pyx_t_16); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_13); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1234, __pyx_L61_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1362, __pyx_L61_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_16)); + __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_16)); #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_16); + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_16); #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L61_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1362, __pyx_L61_error) } else { - __pyx_t_3 = __pyx_t_5(__pyx_t_11); - if (unlikely(!__pyx_t_3)) { + __pyx_t_9 = __pyx_t_5(__pyx_t_13); + if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1234, __pyx_L61_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1362, __pyx_L61_error) PyErr_Clear(); } break; } } - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_9genexpr47__pyx_v_p, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_10 = __pyx_v_self; - __Pyx_INCREF(__pyx_t_10); - __pyx_t_12 = 0; + __Pyx_GOTREF(__pyx_t_9); + __Pyx_XDECREF_SET(__pyx_9genexpr52__pyx_v_p, __pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_12 = __pyx_v_self; + __Pyx_INCREF(__pyx_t_12); + __pyx_t_11 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_9genexpr47__pyx_v_p}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L61_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_9genexpr52__pyx_v_p}; + __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_safe_product, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1362, __pyx_L61_error) + __Pyx_GOTREF(__pyx_t_9); } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1234, __pyx_L61_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1362, __pyx_L61_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_p); __pyx_9genexpr47__pyx_v_p = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_p); __pyx_9genexpr52__pyx_v_p = 0; goto __pyx_L74_exit_scope; __pyx_L61_error:; - __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_p); __pyx_9genexpr47__pyx_v_p = 0; + __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_p); __pyx_9genexpr52__pyx_v_p = 0; goto __pyx_L1_error; __pyx_L74_exit_scope:; } /* exit inner scope */ __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1232 + /* "constraint/constraints.py":1360 * for var in unassigned: * other_unassigned = [v for v in unassigned if v != var] * if other_unassigned: # <<<<<<<<<<<<<< @@ -35132,7 +36638,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint goto __pyx_L51; } - /* "constraint/constraints.py":1236 + /* "constraint/constraints.py":1364 * other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in bounds])] * else: * other_products = [1] # <<<<<<<<<<<<<< @@ -35140,81 +36646,81 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * domain = domains[var] */ /*else*/ { - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 1236, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_int_1) != (0)) __PYX_ERR(0, 1364, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_other_products, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; } __pyx_L51:; - /* "constraint/constraints.py":1238 + /* "constraint/constraints.py":1366 * other_products = [1] * * domain = domains[var] # <<<<<<<<<<<<<< * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1238, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1239 + /* "constraint/constraints.py":1367 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_11 = __pyx_t_1; __Pyx_INCREF(__pyx_t_11); + __pyx_t_13 = __pyx_t_1; __Pyx_INCREF(__pyx_t_13); __pyx_t_16 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_16 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1239, __pyx_L1_error) + __pyx_t_16 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1367, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_11))) { + if (likely(PyList_CheckExact(__pyx_t_13))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1239, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1367, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_11, __pyx_t_16); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_13, __pyx_t_16, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_16; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_13); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1239, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1367, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_16)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_16)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_16); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_16); #endif ++__pyx_t_16; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1367, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_5(__pyx_t_11); + __pyx_t_1 = __pyx_t_5(__pyx_t_13); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1239, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1367, __pyx_L1_error) PyErr_Clear(); } break; @@ -35224,7 +36730,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1240 + /* "constraint/constraints.py":1368 * domain = domains[var] * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] # <<<<<<<<<<<<<< @@ -35232,60 +36738,60 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * domain.hideValue(val) */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L79_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_3); + __pyx_t_9 = __pyx_v_other_products; __Pyx_INCREF(__pyx_t_9); __pyx_t_18 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1240, __pyx_L79_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1368, __pyx_L79_error) #endif if (__pyx_t_18 >= __pyx_temp) break; } - __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_18); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_18; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1240, __pyx_L79_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_XDECREF_SET(__pyx_9genexpr49__pyx_v_o, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_v_val); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1240, __pyx_L79_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_10, __pyx_9genexpr49__pyx_v_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1240, __pyx_L79_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1368, __pyx_L79_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_XDECREF_SET(__pyx_9genexpr54__pyx_v_o, __pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyNumber_Multiply(__pyx_v_assigned_prod, __pyx_v_val); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1368, __pyx_L79_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = PyNumber_Multiply(__pyx_t_12, __pyx_9genexpr54__pyx_v_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1368, __pyx_L79_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1240, __pyx_L79_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 1368, __pyx_L79_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_o); __pyx_9genexpr49__pyx_v_o = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_9genexpr54__pyx_v_o); __pyx_9genexpr54__pyx_v_o = 0; goto __pyx_L83_exit_scope; __pyx_L79_error:; - __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_o); __pyx_9genexpr49__pyx_v_o = 0; + __Pyx_XDECREF(__pyx_9genexpr54__pyx_v_o); __pyx_9genexpr54__pyx_v_o = 0; goto __pyx_L1_error; __pyx_L83_exit_scope:; } /* exit inner scope */ __Pyx_XDECREF_SET(__pyx_v_prods, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/constraints.py":1241 + /* "constraint/constraints.py":1369 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): # <<<<<<<<<<<<<< * domain.hideValue(val) * if not domain: */ - __pyx_t_1 = __pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_8__call___genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_prods); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint_8__call___genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_prods); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1241, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1369, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_8) { - /* "constraint/constraints.py":1242 + /* "constraint/constraints.py":1370 * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): * domain.hideValue(val) # <<<<<<<<<<<<<< @@ -35294,17 +36800,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ __pyx_t_1 = __pyx_v_domain; __Pyx_INCREF(__pyx_t_1); - __pyx_t_12 = 0; + __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_val}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1242, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "constraint/constraints.py":1241 + /* "constraint/constraints.py":1369 * for val in domain[:]: * prods = [assigned_prod * val * o for o in other_products] * if all(p > target_value for p in prods): # <<<<<<<<<<<<<< @@ -35313,7 +36819,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1239 + /* "constraint/constraints.py":1367 * * domain = domains[var] * for val in domain[:]: # <<<<<<<<<<<<<< @@ -35321,20 +36827,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * if all(p > target_value for p in prods): */ } - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "constraint/constraints.py":1243 + /* "constraint/constraints.py":1371 * if all(p > target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< * return False * */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1243, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1371, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_8); if (__pyx_t_2) { - /* "constraint/constraints.py":1244 + /* "constraint/constraints.py":1372 * domain.hideValue(val) * if not domain: * return False # <<<<<<<<<<<<<< @@ -35344,10 +36850,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1243 + /* "constraint/constraints.py":1371 * if all(p > target_value for p in prods): * domain.hideValue(val) * if not domain: # <<<<<<<<<<<<<< @@ -35356,7 +36862,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1230 + /* "constraint/constraints.py":1358 * * if forwardcheck: * for var in unassigned: # <<<<<<<<<<<<<< @@ -35364,9 +36870,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint * if other_unassigned: */ } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "constraint/constraints.py":1229 + /* "constraint/constraints.py":1357 * return False * * if forwardcheck: # <<<<<<<<<<<<<< @@ -35375,7 +36881,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint */ } - /* "constraint/constraints.py":1246 + /* "constraint/constraints.py":1374 * return False * * return True # <<<<<<<<<<<<<< @@ -35387,7 +36893,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1205 + /* "constraint/constraints.py":1333 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -35402,7 +36908,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_17); @@ -35421,17 +36927,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint __Pyx_XDECREF(__pyx_v_domain); __Pyx_XDECREF(__pyx_v_val); __Pyx_XDECREF(__pyx_v_prods); - __Pyx_XDECREF(__pyx_9genexpr41__pyx_v_v); - __Pyx_XDECREF(__pyx_9genexpr42__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_lo); - __Pyx_XDECREF(__pyx_9genexpr43__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr44__pyx_v_c); - __Pyx_XDECREF(__pyx_9genexpr45__pyx_v_v); __Pyx_XDECREF(__pyx_9genexpr46__pyx_v_v); __Pyx_XDECREF(__pyx_9genexpr47__pyx_v_p); __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_lo); __Pyx_XDECREF(__pyx_9genexpr48__pyx_v_hi); - __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_o); + __Pyx_XDECREF(__pyx_9genexpr49__pyx_v_c); + __Pyx_XDECREF(__pyx_9genexpr50__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr51__pyx_v_v); + __Pyx_XDECREF(__pyx_9genexpr52__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_lo); + __Pyx_XDECREF(__pyx_9genexpr53__pyx_v_hi); + __Pyx_XDECREF(__pyx_9genexpr54__pyx_v_o); __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_25VariableMaxProdConstraint_8__call___2generator14); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -35439,7 +36945,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_25VariableMaxProdConstraint return __pyx_r; } -/* "constraint/constraints.py":1260 +/* "constraint/constraints.py":1388 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -35488,39 +36994,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_set,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1260, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1388, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1260, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1388, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1260, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1388, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 1260, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1388, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1260, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1388, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1260, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1388, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1260, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1388, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_set = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1260, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1388, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35549,16 +37055,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1266 + /* "constraint/constraints.py":1394 * set (set): Set of allowed values * """ * self._set = set # <<<<<<<<<<<<<< * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 1266, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < (0)) __PYX_ERR(0, 1394, __pyx_L1_error) - /* "constraint/constraints.py":1260 + /* "constraint/constraints.py":1388 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -35578,7 +37084,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( return __pyx_r; } -/* "constraint/constraints.py":1268 +/* "constraint/constraints.py":1396 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -35629,53 +37135,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1268, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1396, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1268, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1396, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1268, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1396, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1268, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1396, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1268, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1396, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1268, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1396, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 1268, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 1396, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1268, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1396, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1268, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1396, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1268, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1396, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1268, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1396, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1268, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1396, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1268, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1396, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -35689,7 +37195,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1268, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1396, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35715,14 +37221,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; + size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1270 + /* "constraint/constraints.py":1398 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -35730,22 +37235,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_RuntimeError); - __pyx_t_3 = __pyx_builtin_RuntimeError; - __pyx_t_4 = 1; + __pyx_t_3 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Can_t_happen}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1270, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1270, __pyx_L1_error) + __PYX_ERR(0, 1398, __pyx_L1_error) - /* "constraint/constraints.py":1268 + /* "constraint/constraints.py":1396 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -35757,7 +37259,6 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.constraints.InSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); @@ -35765,7 +37266,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ return __pyx_r; } -/* "constraint/constraints.py":1272 +/* "constraint/constraints.py":1400 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -35816,50 +37317,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1272, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1400, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1272, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1400, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1272, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1400, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1272, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1400, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1272, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1400, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1272, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1400, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 1272, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 1400, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1272, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1400, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1272, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1400, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1272, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1400, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1272, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1400, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1272, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1400, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1272, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1400, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -35869,7 +37370,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1272, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1400, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35880,9 +37381,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1272, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1272, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1272, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1400, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1400, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1400, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_15InSetConstraint_4preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -35925,19 +37426,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1273 + /* "constraint/constraints.py":1401 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set # <<<<<<<<<<<<<< * for variable in variables: * domain = domains[variable] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1274 + /* "constraint/constraints.py":1402 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -35949,9 +37450,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1274, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1274, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1402, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -35959,17 +37460,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1274, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1402, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1274, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1402, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -35980,13 +37481,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1274, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1402, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1274, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1402, __pyx_L1_error) PyErr_Clear(); } break; @@ -35996,35 +37497,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1275 + /* "constraint/constraints.py":1403 * set = self._set * for variable in variables: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value not in set: */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1275, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1276 + /* "constraint/constraints.py":1404 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if value not in set: * domain.remove(value) */ - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1276, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1276, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1276, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1404, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -36033,17 +37534,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1276, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1404, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_6); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_5, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1276, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1404, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -36054,13 +37555,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1276, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1404, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1276, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1404, __pyx_L1_error) PyErr_Clear(); } break; @@ -36070,17 +37571,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1277 + /* "constraint/constraints.py":1405 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< * domain.remove(value) * vconstraints[variable].remove((self, variables)) */ - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1277, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1405, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1278 + /* "constraint/constraints.py":1406 * for value in domain[:]: * if value not in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -36092,14 +37593,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1278, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1277 + /* "constraint/constraints.py":1405 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -36108,7 +37609,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce */ } - /* "constraint/constraints.py":1276 + /* "constraint/constraints.py":1404 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -36118,38 +37619,38 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1279 + /* "constraint/constraints.py":1407 * if value not in set: * domain.remove(value) * vconstraints[variable].remove((self, variables)) # <<<<<<<<<<<<<< * constraints.remove((self, variables)) * */ - __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = __pyx_t_9; __Pyx_INCREF(__pyx_t_4); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1279, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1407, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1279, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1407, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; - __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1279, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1274 + /* "constraint/constraints.py":1402 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -36159,27 +37660,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1280 + /* "constraint/constraints.py":1408 * domain.remove(value) * vconstraints[variable].remove((self, variables)) * constraints.remove((self, variables)) # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1280, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1408, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1280, __pyx_L1_error); - __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__remove, __pyx_v_constraints, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1280, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1408, __pyx_L1_error); + __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__remove, __pyx_v_constraints, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1272 + /* "constraint/constraints.py":1400 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -36208,7 +37709,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce return __pyx_r; } -/* "constraint/constraints.py":1294 +/* "constraint/constraints.py":1422 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -36257,39 +37758,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_set,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1294, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1422, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1294, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1422, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1294, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1422, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 1294, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1422, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1294, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 1422, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1294, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1422, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1294, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1422, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_set = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1294, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1422, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36318,16 +37819,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1300 + /* "constraint/constraints.py":1428 * set (set): Set of disallowed values * """ * self._set = set # <<<<<<<<<<<<<< * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 1300, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < (0)) __PYX_ERR(0, 1428, __pyx_L1_error) - /* "constraint/constraints.py":1294 + /* "constraint/constraints.py":1422 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< @@ -36347,7 +37848,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init return __pyx_r; } -/* "constraint/constraints.py":1302 +/* "constraint/constraints.py":1430 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -36398,53 +37899,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1302, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1430, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1302, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1430, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1302, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1430, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1302, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1430, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1302, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1430, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1302, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1430, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 1302, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 1430, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1302, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1430, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1302, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1430, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1302, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1430, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1302, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1430, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1302, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1430, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1302, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1430, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -36458,7 +37959,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1302, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1430, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36484,14 +37985,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; + size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1304 + /* "constraint/constraints.py":1432 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 * # preProcess() will remove it. * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< @@ -36499,22 +37999,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_RuntimeError); - __pyx_t_3 = __pyx_builtin_RuntimeError; - __pyx_t_4 = 1; + __pyx_t_3 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Can_t_happen}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1304, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1304, __pyx_L1_error) + __PYX_ERR(0, 1432, __pyx_L1_error) - /* "constraint/constraints.py":1302 + /* "constraint/constraints.py":1430 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -36526,7 +38023,6 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.constraints.NotInSetConstraint.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); @@ -36534,7 +38030,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal return __pyx_r; } -/* "constraint/constraints.py":1306 +/* "constraint/constraints.py":1434 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -36585,50 +38081,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1306, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1434, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1306, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1434, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1306, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1434, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1306, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1434, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1306, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1434, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1306, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1434, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < 0) __PYX_ERR(0, 1306, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preProcess", 0) < (0)) __PYX_ERR(0, 1434, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 5; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1306, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, i); __PYX_ERR(0, 1434, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 5)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1306, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1434, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1306, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1434, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1306, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1434, __pyx_L3_error) values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1306, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1434, __pyx_L3_error) values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1306, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1434, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -36638,7 +38134,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1306, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("preProcess", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1434, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36649,9 +38145,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1306, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1306, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1306, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1434, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 1434, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 1434, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_18NotInSetConstraint_4preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -36694,19 +38190,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preProcess", 0); - /* "constraint/constraints.py":1307 + /* "constraint/constraints.py":1435 * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set # <<<<<<<<<<<<<< * for variable in variables: * domain = domains[variable] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1307, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1308 + /* "constraint/constraints.py":1436 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -36718,9 +38214,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1308, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1308, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1436, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -36728,17 +38224,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1308, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1436, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1308, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1436, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -36749,13 +38245,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1308, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1308, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1436, __pyx_L1_error) PyErr_Clear(); } break; @@ -36765,35 +38261,35 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1309 + /* "constraint/constraints.py":1437 * set = self._set * for variable in variables: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value in set: */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1309, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1310 + /* "constraint/constraints.py":1438 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if value in set: * domain.remove(value) */ - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1310, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1310, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1310, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1438, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -36802,17 +38298,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1310, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1438, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_6); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_5, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1310, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1438, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } @@ -36823,13 +38319,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr #endif ++__pyx_t_6; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1310, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1438, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1310, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1438, __pyx_L1_error) PyErr_Clear(); } break; @@ -36839,17 +38335,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1311 + /* "constraint/constraints.py":1439 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< * domain.remove(value) * vconstraints[variable].remove((self, variables)) */ - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1311, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1439, __pyx_L1_error) if (__pyx_t_8) { - /* "constraint/constraints.py":1312 + /* "constraint/constraints.py":1440 * for value in domain[:]: * if value in set: * domain.remove(value) # <<<<<<<<<<<<<< @@ -36861,14 +38357,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_value}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1312, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1311 + /* "constraint/constraints.py":1439 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -36877,7 +38373,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr */ } - /* "constraint/constraints.py":1310 + /* "constraint/constraints.py":1438 * for variable in variables: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -36887,38 +38383,38 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1313 + /* "constraint/constraints.py":1441 * if value in set: * domain.remove(value) * vconstraints[variable].remove((self, variables)) # <<<<<<<<<<<<<< * constraints.remove((self, variables)) * */ - __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1313, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = __pyx_t_9; __Pyx_INCREF(__pyx_t_4); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1313, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1313, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1441, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1313, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1441, __pyx_L1_error); __pyx_t_10 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_11}; - __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1313, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1308 + /* "constraint/constraints.py":1436 * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 * set = self._set * for variable in variables: # <<<<<<<<<<<<<< @@ -36928,27 +38424,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1314 + /* "constraint/constraints.py":1442 * domain.remove(value) * vconstraints[variable].remove((self, variables)) * constraints.remove((self, variables)) # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1314, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 1442, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1314, __pyx_L1_error); - __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__remove, __pyx_v_constraints, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1314, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 1442, __pyx_L1_error); + __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__remove, __pyx_v_constraints, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1306 + /* "constraint/constraints.py":1434 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< @@ -36977,7 +38473,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr return __pyx_r; } -/* "constraint/constraints.py":1328 +/* "constraint/constraints.py":1456 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -37028,50 +38524,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_set,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_exact,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1328, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1456, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1328, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1456, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1328, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1456, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1328, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1456, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1328, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1456, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 1328, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1456, __pyx_L3_error) if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_1))); if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1328, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1456, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1328, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1456, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1328, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1456, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1328, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1456, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1328, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1456, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -37085,7 +38581,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1328, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1456, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37114,34 +38610,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1338 + /* "constraint/constraints.py":1466 * are present in set must be exactly `n` * """ * self._set = set # <<<<<<<<<<<<<< * self._n = n * self._exact = exact */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 1338, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < (0)) __PYX_ERR(0, 1466, __pyx_L1_error) - /* "constraint/constraints.py":1339 + /* "constraint/constraints.py":1467 * """ * self._set = set * self._n = n # <<<<<<<<<<<<<< * self._exact = exact * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2, __pyx_v_n) < 0) __PYX_ERR(0, 1339, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2, __pyx_v_n) < (0)) __PYX_ERR(0, 1467, __pyx_L1_error) - /* "constraint/constraints.py":1340 + /* "constraint/constraints.py":1468 * self._set = set * self._n = n * self._exact = exact # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2, __pyx_v_exact) < 0) __PYX_ERR(0, 1340, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2, __pyx_v_exact) < (0)) __PYX_ERR(0, 1468, __pyx_L1_error) - /* "constraint/constraints.py":1328 + /* "constraint/constraints.py":1456 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -37161,7 +38657,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini return __pyx_r; } -/* "constraint/constraints.py":1342 +/* "constraint/constraints.py":1470 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -37212,53 +38708,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1342, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1470, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1342, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1470, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1342, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1470, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1342, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1470, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1342, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1470, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1342, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1470, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 1342, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 1470, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1342, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1470, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1342, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1470, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1342, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1470, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1342, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1470, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1342, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1470, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1342, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1470, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -37272,7 +38768,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1342, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1470, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -37283,8 +38779,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1342, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1342, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1470, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1470, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -37329,19 +38825,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1343 + /* "constraint/constraints.py":1471 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set # <<<<<<<<<<<<<< * missing = 0 * found = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1344 + /* "constraint/constraints.py":1472 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -37351,7 +38847,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":1345 + /* "constraint/constraints.py":1473 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -37361,7 +38857,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_found = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":1346 + /* "constraint/constraints.py":1474 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -37373,9 +38869,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1474, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -37383,17 +38879,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1346, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1474, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1346, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1474, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37404,13 +38900,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1474, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1346, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1474, __pyx_L1_error) PyErr_Clear(); } break; @@ -37420,36 +38916,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1347 + /* "constraint/constraints.py":1475 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< * found += assignments[variable] in set * else: */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1475, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1348 + /* "constraint/constraints.py":1476 * for variable in variables: * if variable in assignments: * found += assignments[variable] in set # <<<<<<<<<<<<<< * else: * missing += 1 */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_set, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_set, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1476, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_found, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1347 + /* "constraint/constraints.py":1475 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -37459,7 +38955,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L5; } - /* "constraint/constraints.py":1350 + /* "constraint/constraints.py":1478 * found += assignments[variable] in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -37467,14 +38963,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if self._exact: */ /*else*/ { - __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_v_missing, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1350, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_v_missing, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_missing, __pyx_t_6); __pyx_t_6 = 0; } __pyx_L5:; - /* "constraint/constraints.py":1346 + /* "constraint/constraints.py":1474 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -37484,53 +38980,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1351 + /* "constraint/constraints.py":1479 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< * if self._exact: * if not (found <= self._n <= missing + found): */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1351, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1479, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1352 + /* "constraint/constraints.py":1480 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< * if not (found <= self._n <= missing + found): * return False */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1352, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1353 + /* "constraint/constraints.py":1481 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< * return False * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_found, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1353, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_found, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1481, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_6)) { __Pyx_DECREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1353, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1353, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1353, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = (!__pyx_t_5); if (__pyx_t_7) { - /* "constraint/constraints.py":1354 + /* "constraint/constraints.py":1482 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -37542,7 +39038,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1353 + /* "constraint/constraints.py":1481 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -37551,7 +39047,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1352 + /* "constraint/constraints.py":1480 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -37561,7 +39057,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L8; } - /* "constraint/constraints.py":1356 + /* "constraint/constraints.py":1484 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -37569,18 +39065,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if forwardcheck and self._n - found == missing: */ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1356, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1356, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1356, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1357 + /* "constraint/constraints.py":1485 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -37592,7 +39088,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1356 + /* "constraint/constraints.py":1484 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -37603,33 +39099,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L8:; - /* "constraint/constraints.py":1358 + /* "constraint/constraints.py":1486 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< * # All unassigned variables must be assigned to * # values in the set. */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1358, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1486, __pyx_L1_error) if (__pyx_t_5) { } else { __pyx_t_7 = __pyx_t_5; goto __pyx_L12_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1358, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_missing, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1358, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_missing, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1358, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __pyx_t_5; __pyx_L12_bool_binop_done:; if (__pyx_t_7) { - /* "constraint/constraints.py":1361 + /* "constraint/constraints.py":1489 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -37641,9 +39137,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1489, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -37651,17 +39147,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1361, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1489, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_2); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1361, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1489, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -37672,13 +39168,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1489, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1361, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1489, __pyx_L1_error) PyErr_Clear(); } break; @@ -37688,45 +39184,45 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1362 + /* "constraint/constraints.py":1490 * # values in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: */ - __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1362, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1490, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1363 + /* "constraint/constraints.py":1491 * for variable in variables: * if variable not in assignments: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value not in set: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1364 + /* "constraint/constraints.py":1492 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if value not in set: * domain.hideValue(value) */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1364, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1364, __pyx_L1_error) + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1492, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -37735,17 +39231,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1364, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1492, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_8); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1364, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1492, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -37756,13 +39252,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1492, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1364, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1492, __pyx_L1_error) PyErr_Clear(); } break; @@ -37772,17 +39268,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1365 + /* "constraint/constraints.py":1493 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1365, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1493, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1366 + /* "constraint/constraints.py":1494 * for value in domain[:]: * if value not in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -37794,14 +39290,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1365 + /* "constraint/constraints.py":1493 * domain = domains[variable] * for value in domain[:]: * if value not in set: # <<<<<<<<<<<<<< @@ -37810,7 +39306,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1364 + /* "constraint/constraints.py":1492 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -37820,18 +39316,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1367 + /* "constraint/constraints.py":1495 * if value not in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * else: */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1367, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1495, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1368 + /* "constraint/constraints.py":1496 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -37844,7 +39340,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1367 + /* "constraint/constraints.py":1495 * if value not in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -37853,7 +39349,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1362 + /* "constraint/constraints.py":1490 * # values in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -37862,7 +39358,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1361 + /* "constraint/constraints.py":1489 * # All unassigned variables must be assigned to * # values in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -37872,7 +39368,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1358 + /* "constraint/constraints.py":1486 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -37881,7 +39377,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1351 + /* "constraint/constraints.py":1479 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -37891,7 +39387,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L7; } - /* "constraint/constraints.py":1370 + /* "constraint/constraints.py":1498 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -37899,28 +39395,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * return False */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1498, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1371 + /* "constraint/constraints.py":1499 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< * return False * else: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1371, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_found, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1371, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_found, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1499, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1371, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1499, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1372 + /* "constraint/constraints.py":1500 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -37932,7 +39428,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1371 + /* "constraint/constraints.py":1499 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -37941,7 +39437,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca */ } - /* "constraint/constraints.py":1370 + /* "constraint/constraints.py":1498 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -37951,7 +39447,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca goto __pyx_L23; } - /* "constraint/constraints.py":1374 + /* "constraint/constraints.py":1502 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -37959,15 +39455,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * return True */ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1374, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_found, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1374, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_found, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1502, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1374, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1502, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1375 + /* "constraint/constraints.py":1503 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< @@ -37979,7 +39475,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1374 + /* "constraint/constraints.py":1502 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -37992,7 +39488,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } __pyx_L7:; - /* "constraint/constraints.py":1376 + /* "constraint/constraints.py":1504 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< @@ -38004,7 +39500,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1342 + /* "constraint/constraints.py":1470 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -38032,7 +39528,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca return __pyx_r; } -/* "constraint/constraints.py":1390 +/* "constraint/constraints.py":1518 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -38083,50 +39579,50 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_set,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_exact,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1390, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1518, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1390, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1518, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1390, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1518, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1390, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1518, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1390, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1518, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 1390, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 1518, __pyx_L3_error) if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_1))); if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1390, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, i); __PYX_ERR(0, 1518, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1390, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1518, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1390, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1518, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1390, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1518, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1390, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1518, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -38140,7 +39636,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1390, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 1518, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38169,34 +39665,34 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/constraints.py":1400 + /* "constraint/constraints.py":1528 * are not present in set must be exactly `n` * """ * self._set = set # <<<<<<<<<<<<<< * self._n = n * self._exact = exact */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 1400, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < (0)) __PYX_ERR(0, 1528, __pyx_L1_error) - /* "constraint/constraints.py":1401 + /* "constraint/constraints.py":1529 * """ * self._set = set * self._n = n # <<<<<<<<<<<<<< * self._exact = exact * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2, __pyx_v_n) < 0) __PYX_ERR(0, 1401, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2, __pyx_v_n) < (0)) __PYX_ERR(0, 1529, __pyx_L1_error) - /* "constraint/constraints.py":1402 + /* "constraint/constraints.py":1530 * self._set = set * self._n = n * self._exact = exact # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2, __pyx_v_exact) < 0) __PYX_ERR(0, 1402, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2, __pyx_v_exact) < (0)) __PYX_ERR(0, 1530, __pyx_L1_error) - /* "constraint/constraints.py":1390 + /* "constraint/constraints.py":1518 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< @@ -38216,7 +39712,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ return __pyx_r; } -/* "constraint/constraints.py":1404 +/* "constraint/constraints.py":1532 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -38267,53 +39763,53 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1404, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1532, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1404, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1532, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1404, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1532, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1404, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1532, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1404, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1532, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1404, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1532, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 1404, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(0, 1532, __pyx_L3_error) if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1404, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, i); __PYX_ERR(0, 1532, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1404, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1532, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1404, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1532, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1404, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1532, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1404, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1532, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1404, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1532, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -38327,7 +39823,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1404, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__call__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1532, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -38338,8 +39834,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1404, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1404, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 1532, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 1532, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -38384,19 +39880,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "constraint/constraints.py":1405 + /* "constraint/constraints.py":1533 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set # <<<<<<<<<<<<<< * missing = 0 * found = 0 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1405, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/constraints.py":1406 + /* "constraint/constraints.py":1534 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 * set = self._set * missing = 0 # <<<<<<<<<<<<<< @@ -38406,7 +39902,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":1407 + /* "constraint/constraints.py":1535 * set = self._set * missing = 0 * found = 0 # <<<<<<<<<<<<<< @@ -38416,7 +39912,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_v_found = __pyx_mstate_global->__pyx_int_0; - /* "constraint/constraints.py":1408 + /* "constraint/constraints.py":1536 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -38428,9 +39924,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1408, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1536, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -38438,17 +39934,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1408, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1536, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1408, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1536, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38459,13 +39955,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1408, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1536, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1408, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1536, __pyx_L1_error) PyErr_Clear(); } break; @@ -38475,36 +39971,36 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1409 + /* "constraint/constraints.py":1537 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< * found += assignments[variable] not in set * else: */ - __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1537, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1410 + /* "constraint/constraints.py":1538 * for variable in variables: * if variable in assignments: * found += assignments[variable] not in set # <<<<<<<<<<<<<< * else: * missing += 1 */ - __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1410, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_set, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1410, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_set, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1410, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1410, __pyx_L1_error) + __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_found, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_found, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1409 + /* "constraint/constraints.py":1537 * found = 0 * for variable in variables: * if variable in assignments: # <<<<<<<<<<<<<< @@ -38514,7 +40010,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L5; } - /* "constraint/constraints.py":1412 + /* "constraint/constraints.py":1540 * found += assignments[variable] not in set * else: * missing += 1 # <<<<<<<<<<<<<< @@ -38522,14 +40018,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if self._exact: */ /*else*/ { - __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_v_missing, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1412, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_v_missing, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_missing, __pyx_t_6); __pyx_t_6 = 0; } __pyx_L5:; - /* "constraint/constraints.py":1408 + /* "constraint/constraints.py":1536 * missing = 0 * found = 0 * for variable in variables: # <<<<<<<<<<<<<< @@ -38539,53 +40035,53 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1413 + /* "constraint/constraints.py":1541 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< * if self._exact: * if not (found <= self._n <= missing + found): */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1413, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1541, __pyx_L1_error) if (__pyx_t_5) { - /* "constraint/constraints.py":1414 + /* "constraint/constraints.py":1542 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< * if not (found <= self._n <= missing + found): * return False */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1414, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1414, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1542, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1415 + /* "constraint/constraints.py":1543 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< * return False * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1415, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_found, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1415, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_found, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1543, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_6)) { __Pyx_DECREF(__pyx_t_6); - __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1415, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1415, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1543, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1415, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1543, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = (!__pyx_t_5); if (__pyx_t_7) { - /* "constraint/constraints.py":1416 + /* "constraint/constraints.py":1544 * if self._exact: * if not (found <= self._n <= missing + found): * return False # <<<<<<<<<<<<<< @@ -38597,7 +40093,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1415 + /* "constraint/constraints.py":1543 * if missing: * if self._exact: * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< @@ -38606,7 +40102,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1414 + /* "constraint/constraints.py":1542 * missing += 1 * if missing: * if self._exact: # <<<<<<<<<<<<<< @@ -38616,7 +40112,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L8; } - /* "constraint/constraints.py":1418 + /* "constraint/constraints.py":1546 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -38624,18 +40120,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if forwardcheck and self._n - found == missing: */ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1418, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1418, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1418, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1546, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - /* "constraint/constraints.py":1419 + /* "constraint/constraints.py":1547 * else: * if self._n > missing + found: * return False # <<<<<<<<<<<<<< @@ -38647,7 +40143,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1418 + /* "constraint/constraints.py":1546 * return False * else: * if self._n > missing + found: # <<<<<<<<<<<<<< @@ -38658,33 +40154,33 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L8:; - /* "constraint/constraints.py":1420 + /* "constraint/constraints.py":1548 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< * # All unassigned variables must be assigned to * # values not in the set. */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1548, __pyx_L1_error) if (__pyx_t_5) { } else { __pyx_t_7 = __pyx_t_5; goto __pyx_L12_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_missing, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_v_missing, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1548, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1548, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __pyx_t_5; __pyx_L12_bool_binop_done:; if (__pyx_t_7) { - /* "constraint/constraints.py":1423 + /* "constraint/constraints.py":1551 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -38696,9 +40192,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1423, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1423, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1551, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -38706,17 +40202,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1423, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1551, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_2); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1423, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1551, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -38727,13 +40223,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1551, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_3(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1423, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1551, __pyx_L1_error) PyErr_Clear(); } break; @@ -38743,45 +40239,45 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1424 + /* "constraint/constraints.py":1552 * # values not in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: */ - __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1424, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1552, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1425 + /* "constraint/constraints.py":1553 * for variable in variables: * if variable not in assignments: * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value in set: */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1426 + /* "constraint/constraints.py":1554 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if value in set: * domain.hideValue(value) */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1426, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1426, __pyx_L1_error) + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1554, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -38790,17 +40286,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1426, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1554, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_8); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_8; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1426, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1554, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } @@ -38811,13 +40307,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ #endif ++__pyx_t_8; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1426, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1554, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1426, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1554, __pyx_L1_error) PyErr_Clear(); } break; @@ -38827,17 +40323,17 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1427 + /* "constraint/constraints.py":1555 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: */ - __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1555, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/constraints.py":1428 + /* "constraint/constraints.py":1556 * for value in domain[:]: * if value in set: * domain.hideValue(value) # <<<<<<<<<<<<<< @@ -38849,14 +40345,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/constraints.py":1427 + /* "constraint/constraints.py":1555 * domain = domains[variable] * for value in domain[:]: * if value in set: # <<<<<<<<<<<<<< @@ -38865,7 +40361,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1426 + /* "constraint/constraints.py":1554 * if variable not in assignments: * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< @@ -38875,18 +40371,18 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1429 + /* "constraint/constraints.py":1557 * if value in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< * return False * else: */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1557, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { - /* "constraint/constraints.py":1430 + /* "constraint/constraints.py":1558 * domain.hideValue(value) * if not domain: * return False # <<<<<<<<<<<<<< @@ -38899,7 +40395,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "constraint/constraints.py":1429 + /* "constraint/constraints.py":1557 * if value in set: * domain.hideValue(value) * if not domain: # <<<<<<<<<<<<<< @@ -38908,7 +40404,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1424 + /* "constraint/constraints.py":1552 * # values not in the set. * for variable in variables: * if variable not in assignments: # <<<<<<<<<<<<<< @@ -38917,7 +40413,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1423 + /* "constraint/constraints.py":1551 * # All unassigned variables must be assigned to * # values not in the set. * for variable in variables: # <<<<<<<<<<<<<< @@ -38927,7 +40423,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1420 + /* "constraint/constraints.py":1548 * if self._n > missing + found: * return False * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< @@ -38936,7 +40432,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1413 + /* "constraint/constraints.py":1541 * else: * missing += 1 * if missing: # <<<<<<<<<<<<<< @@ -38946,7 +40442,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L7; } - /* "constraint/constraints.py":1432 + /* "constraint/constraints.py":1560 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -38954,28 +40450,28 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * return False */ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1433 + /* "constraint/constraints.py":1561 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< * return False * else: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_found, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_found, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1561, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1561, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1434 + /* "constraint/constraints.py":1562 * if self._exact: * if found != self._n: * return False # <<<<<<<<<<<<<< @@ -38987,7 +40483,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1433 + /* "constraint/constraints.py":1561 * else: * if self._exact: * if found != self._n: # <<<<<<<<<<<<<< @@ -38996,7 +40492,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ */ } - /* "constraint/constraints.py":1432 + /* "constraint/constraints.py":1560 * return False * else: * if self._exact: # <<<<<<<<<<<<<< @@ -39006,7 +40502,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ goto __pyx_L23; } - /* "constraint/constraints.py":1436 + /* "constraint/constraints.py":1564 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -39014,26 +40510,27 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * return True */ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1436, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_found, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_found, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1564, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1436, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1564, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "constraint/constraints.py":1437 + /* "constraint/constraints.py":1565 * else: * if found < self._n: * return False # <<<<<<<<<<<<<< * return True + * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; - /* "constraint/constraints.py":1436 + /* "constraint/constraints.py":1564 * return False * else: * if found < self._n: # <<<<<<<<<<<<<< @@ -39046,17 +40543,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } __pyx_L7:; - /* "constraint/constraints.py":1438 + /* "constraint/constraints.py":1566 * if found < self._n: * return False * return True # <<<<<<<<<<<<<< + * + * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; - /* "constraint/constraints.py":1404 + /* "constraint/constraints.py":1532 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< @@ -39083,24 +40582,403 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_RefNannyFinishContext(); return __pyx_r; } + +/* "constraint/constraints.py":1571 + * # Utility functions + * + * def sum_other_vars(variables: Sequence, variable, values: dict): # <<<<<<<<<<<<<< + * """Calculate the sum of the given values of all other variables.""" + * return sum(values[v] for v in variables if v != variable) +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_11constraints_1sum_other_vars(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10constraint_11constraints_sum_other_vars, "Calculate the sum of the given values of all other variables."); +static PyMethodDef __pyx_mdef_10constraint_11constraints_1sum_other_vars = {"sum_other_vars", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_11constraints_1sum_other_vars, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_11constraints_sum_other_vars}; +static PyObject *__pyx_pw_10constraint_11constraints_1sum_other_vars(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_variables = 0; + PyObject *__pyx_v_variable = 0; + PyObject *__pyx_v_values = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("sum_other_vars (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_SIZE + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_variable,&__pyx_mstate_global->__pyx_n_u_values,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 1571, __pyx_L3_error) + if (__pyx_kwds_len > 0) { + switch (__pyx_nargs) { + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1571, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1571, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1571, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sum_other_vars", 0) < (0)) __PYX_ERR(0, 1571, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sum_other_vars", 1, 3, 3, i); __PYX_ERR(0, 1571, __pyx_L3_error) } + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1571, __pyx_L3_error) + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1571, __pyx_L3_error) + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1571, __pyx_L3_error) + } + __pyx_v_variables = values[0]; + __pyx_v_variable = values[1]; + __pyx_v_values = ((PyObject*)values[2]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("sum_other_vars", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1571, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __Pyx_AddTraceback("constraint.constraints.sum_other_vars", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), (&PyDict_Type), 0, "values", 2))) __PYX_ERR(0, 1571, __pyx_L1_error) + __pyx_r = __pyx_pf_10constraint_11constraints_sum_other_vars(__pyx_self, __pyx_v_variables, __pyx_v_variable, __pyx_v_values); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + goto __pyx_L7_cleaned_up; + __pyx_L0:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __pyx_L7_cleaned_up:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/constraints.py":1573 + * def sum_other_vars(variables: Sequence, variable, values: dict): + * """Calculate the sum of the given values of all other variables.""" + * return sum(values[v] for v in variables if v != variable) # <<<<<<<<<<<<<< +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_14sum_other_vars_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_22_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 1573, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars *) __pyx_self; + __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); + __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_14sum_other_vars_2generator15, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_sum_other_vars_locals_genexpr, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 1573, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.constraints.sum_other_vars.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L7_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(__pyx_sent_value != Py_None)) { + if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); + __PYX_ERR(0, 1573, __pyx_L1_error) + } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1573, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1573, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1573, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_2; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1573, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); + #endif + ++__pyx_t_2; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1573, __pyx_L1_error) + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 1573, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable)) { __Pyx_RaiseClosureNameError("variable"); __PYX_ERR(0, 1573, __pyx_L1_error) } + __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_v, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1573, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_values)) { __Pyx_RaiseClosureNameError("values"); __PYX_ERR(0, 1573, __pyx_L1_error) } + if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_values == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); + __PYX_ERR(0, 1573, __pyx_L1_error) + } + __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_values, __pyx_cur_scope->__pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + __Pyx_XGIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L7_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1573, __pyx_L1_error) + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/constraints.py":1571 + * # Utility functions + * + * def sum_other_vars(variables: Sequence, variable, values: dict): # <<<<<<<<<<<<<< + * """Calculate the sum of the given values of all other variables.""" + * return sum(values[v] for v in variables if v != variable) +*/ + +static PyObject *__pyx_pf_10constraint_11constraints_sum_other_vars(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_variable, PyObject *__pyx_v_values) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars *__pyx_cur_scope; + PyObject *__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator15 = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + size_t __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sum_other_vars", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 1571, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_variable = __pyx_v_variable; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_variable); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_variable); + __pyx_cur_scope->__pyx_v_values = __pyx_v_values; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_values); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_values); + + /* "constraint/constraints.py":1573 + * def sum_other_vars(variables: Sequence, variable, values: dict): + * """Calculate the sum of the given values of all other variables.""" + * return sum(values[v] for v in variables if v != variable) # <<<<<<<<<<<<<< +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = NULL; + __pyx_t_3 = __pyx_pf_10constraint_11constraints_14sum_other_vars_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_sum, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "constraint/constraints.py":1571 + * # Utility functions + * + * def sum_other_vars(variables: Sequence, variable, values: dict): # <<<<<<<<<<<<<< + * """Calculate the sum of the given values of all other variables.""" + * return sum(values[v] for v in variables if v != variable) +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("constraint.constraints.sum_other_vars", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_gb_10constraint_11constraints_14sum_other_vars_2generator15); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} /* #### Code section: module_exttypes ### */ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_defaults(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; - #endif return o; } static void __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults(PyObject *o) { struct __pyx_defaults *p = (struct __pyx_defaults *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -39108,14 +40986,18 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults(PyObject #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->arg0); + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } static int __pyx_tp_traverse_10constraint_11constraints___pyx_defaults(PyObject *o, visitproc v, void *a) { @@ -39151,7 +41033,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_defaults_spec = { "constraint.constraints.__pyx_defaults", sizeof(struct __pyx_defaults), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_11constraints___pyx_defaults_slots, }; #else @@ -39162,12 +41044,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { sizeof(struct __pyx_defaults), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -39181,7 +41058,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_11constraints___pyx_defaults, /*tp_traverse*/ __pyx_tp_clear_10constraint_11constraints___pyx_defaults, /*tp_clear*/ @@ -39216,7 +41093,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -39236,30 +41113,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__genexpr(PyObject *o) { struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -39269,19 +41149,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__gene Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_m); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -39311,7 +41196,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct__gen "constraint.constraints.__pyx_scope_struct__genexpr", sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_slots, }; #else @@ -39322,12 +41207,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__ge sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -39341,7 +41221,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__ge 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -39376,7 +41256,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__ge #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -39396,30 +41276,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__ge static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_preProcess(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_preProcess > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_preProcess > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_preProcess[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_preProcess]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_preProcess(PyObject *o) { struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_preProcess) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -39429,19 +41312,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_pre Py_CLEAR(p->__pyx_v_domains); Py_CLEAR(p->__pyx_v_var); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_preProcess < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_preProcess < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_preProcess[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_preProcess++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -39484,7 +41372,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_1_pr "constraint.constraints.__pyx_scope_struct_1_preProcess", sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess_slots, }; #else @@ -39495,12 +41383,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_p sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_preProcess), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_preProcess, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -39514,7 +41397,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_p 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_preProcess, /*tp_traverse*/ __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_1_preProcess, /*tp_clear*/ @@ -39549,7 +41432,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_p #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -39569,30 +41452,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_p static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_2_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_2_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_2_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr(PyObject *o) { struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -39604,19 +41490,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_gen Py_CLEAR(p->__pyx_v_v); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_2_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_2_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -39652,7 +41543,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_2_ge "constraint.constraints.__pyx_scope_struct_2_genexpr", sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_slots, }; #else @@ -39663,12 +41554,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_g sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -39682,7 +41568,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_g 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_2_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -39717,7 +41603,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_g #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -39737,30 +41623,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_2_g static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_3_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_3_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_3_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr(PyObject *o) { struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -39772,19 +41661,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_gen Py_CLEAR(p->__pyx_v_v); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_3_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_3_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -39820,7 +41714,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_3_ge "constraint.constraints.__pyx_scope_struct_3_genexpr", sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_slots, }; #else @@ -39831,12 +41725,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -39850,7 +41739,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_3_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -39885,7 +41774,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -39905,30 +41794,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_3_g static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_4_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_4_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_4_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr(PyObject *o) { struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -39938,19 +41830,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_gen Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_m); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_4_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_4_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -39980,7 +41877,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_4_ge "constraint.constraints.__pyx_scope_struct_4_genexpr", sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_slots, }; #else @@ -39991,12 +41888,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -40010,7 +41902,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_4_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -40045,7 +41937,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -40065,30 +41957,33 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_4_g static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_5_preProcess > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_5_preProcess > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_5_preProcess[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_5_preProcess]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess(PyObject *o) { struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -40098,19 +41993,24 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_pre Py_CLEAR(p->__pyx_v_domains); Py_CLEAR(p->__pyx_v_var); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_5_preProcess < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_5_preProcess < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_5_preProcess[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_5_preProcess++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -40153,7 +42053,7 @@ static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_5_pr "constraint.constraints.__pyx_scope_struct_5_preProcess", sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_slots, }; #else @@ -40164,12 +42064,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_p sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_5_preProcess), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -40183,7 +42078,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_p 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_traverse*/ __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_5_preProcess, /*tp_clear*/ @@ -40218,7 +42113,341 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_p #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_USE_FREELISTS + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_6_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_6_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_6_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else + (void) PyObject_INIT(o, t); + #endif + PyObject_GC_Track(o); + } else + #endif + { + o = __Pyx_AllocateExtensionType(t, 1); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_v); + Py_CLEAR(p->__pyx_t_0); + #if CYTHON_USE_FREELISTS + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_6_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_6_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr *)o); + } else + #endif + { + PyTypeObject *tp = Py_TYPE(o); + #if CYTHON_USE_TYPE_SLOTS + (*tp->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_v) { + e = (*v)(p->__pyx_v_v, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_6_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_6_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ + 0, /*tp_vectorcall_offset*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_as_async*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_USE_FREELISTS + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_7_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_7_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_7_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else + (void) PyObject_INIT(o, t); + #endif + PyObject_GC_Track(o); + } else + #endif + { + o = __Pyx_AllocateExtensionType(t, 1); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_m); + #if CYTHON_USE_FREELISTS + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_7_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_7_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *)o); + } else + #endif + { + PyTypeObject *tp = Py_TYPE(o); + #if CYTHON_USE_TYPE_SLOTS + (*tp->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif + } +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_m) { + e = (*v)(p->__pyx_v_m, a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_7_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_scope_struct_7_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_dealloc*/ + 0, /*tp_vectorcall_offset*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_as_async*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -40236,108 +42465,116 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_5_p }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_preProcess(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_6_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_6_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_6_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_8_preProcess > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_8_preProcess[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_8_preProcess]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_preProcess(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_preProcess) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_v); - Py_CLEAR(p->__pyx_t_0); + Py_CLEAR(p->__pyx_v_domains); + Py_CLEAR(p->__pyx_v_var); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_6_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_6_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_8_preProcess < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_8_preProcess[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_8_preProcess++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_preProcess(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_genexpr_arg_0) { - e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; - } - if (p->__pyx_v_v) { - e = (*v)(p->__pyx_v_v, a); if (e) return e; + if (p->__pyx_v_domains) { + e = (*v)(p->__pyx_v_domains, a); if (e) return e; } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; + if (p->__pyx_v_var) { + e = (*v)(p->__pyx_v_var, a); if (e) return e; } return 0; } + +static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_8_preProcess(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess *)o; + tmp = ((PyObject*)p->__pyx_v_domains); + p->__pyx_v_domains = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_var); + p->__pyx_v_var = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_8_preProcess_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_preProcess}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_preProcess}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_8_preProcess}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_preProcess}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_6_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_8_preProcess_spec = { + "constraint.constraints.__pyx_scope_struct_8_preProcess", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_8_preProcess_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_preProcess = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_6_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_8_preProcess", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_preProcess), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_preProcess, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -40351,10 +42588,10 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_g 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_preProcess, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_8_preProcess, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -40371,7 +42608,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_6_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_preProcess, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -40386,7 +42623,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_g #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -40404,100 +42641,111 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_6_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_7_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_7_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_7_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_9_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_9_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_9_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_genexpr) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_value); + Py_CLEAR(p->__pyx_v_v); + Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_7_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_7_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_9_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_9_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_9_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_9_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } - if (p->__pyx_v_value) { - e = (*v)(p->__pyx_v_value, a); if (e) return e; + if (p->__pyx_v_v) { + e = (*v)(p->__pyx_v_v, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_9_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_9_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_7_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_9_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_9_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_9_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_7_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_7_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_9_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_genexpr, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -40511,9 +42759,9 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_g 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_9_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -40531,7 +42779,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_7_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -40546,7 +42794,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_g #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -40564,60 +42812,68 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_7_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_10_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_8_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_8_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_8_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_10_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_10_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_10_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_genexpr) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_m); + Py_CLEAR(p->__pyx_v_value); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_8_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_8_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_8_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_10_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_10_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_10_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -40625,39 +42881,34 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_gen if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } - if (p->__pyx_v_m) { - e = (*v)(p->__pyx_v_m, a); if (e) return e; + if (p->__pyx_v_value) { + e = (*v)(p->__pyx_v_value, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_10_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_8_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_10_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_8_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_8_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_10_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -40671,9 +42922,9 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_g 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -40691,7 +42942,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_g #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_8_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -40706,7 +42957,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_g #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -40724,113 +42975,103 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_8_g }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_preProcess(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_9_preProcess > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_9_preProcess[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_9_preProcess]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_11_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_11_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_11_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_preProcess(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_preProcess) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_domains); - Py_CLEAR(p->__pyx_v_var); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_value); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_9_preProcess < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_9_preProcess[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_9_preProcess++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_11_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_11_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_11_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_9_preProcess(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } - if (p->__pyx_v_domains) { - e = (*v)(p->__pyx_v_domains, a); if (e) return e; + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } - if (p->__pyx_v_var) { - e = (*v)(p->__pyx_v_var, a); if (e) return e; + if (p->__pyx_v_value) { + e = (*v)(p->__pyx_v_value, a); if (e) return e; } return 0; } - -static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_9_preProcess(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess *)o; - tmp = ((PyObject*)p->__pyx_v_domains); - p->__pyx_v_domains = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_var); - p->__pyx_v_var = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_preProcess}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_9_preProcess}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_9_preProcess}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_preProcess}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess_spec = { - "constraint.constraints.__pyx_scope_struct_9_preProcess", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_11_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_9_preProcess", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_9_preProcess), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_11_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -40844,10 +43085,10 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_p 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_traverse*/ - __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -40864,7 +43105,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_p #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_9_preProcess, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -40879,7 +43120,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_p #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -40897,108 +43138,109 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_9_p }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_10_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12___call__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_10_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_10_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_10_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12___call__ > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12___call__[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12___call__]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___call__(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___call__) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_v); - Py_CLEAR(p->__pyx_t_0); + Py_CLEAR(p->__pyx_v_assigned_product); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_10_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_10_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_10_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12___call__ < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12___call__[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12___call__++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12___call__(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_genexpr_arg_0) { - e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; - } - if (p->__pyx_v_v) { - e = (*v)(p->__pyx_v_v, a); if (e) return e; - } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; + if (p->__pyx_v_assigned_product) { + e = (*v)(p->__pyx_v_assigned_product, a); if (e) return e; } return 0; } + +static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_12___call__(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)o; + tmp = ((PyObject*)p->__pyx_v_assigned_product); + p->__pyx_v_assigned_product = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_10_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call___slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___call__}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12___call__}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_12___call__}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12___call__}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_10_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call___spec = { + "constraint.constraints.__pyx_scope_struct_12___call__", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call___slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__ = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_10_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_10_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_12___call__", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___call__, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -41012,10 +43254,10 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12___call__, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_12___call__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -41032,7 +43274,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_10_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12___call__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41047,7 +43289,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_ #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -41065,100 +43307,111 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_10_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_11_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_11_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_11_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_13_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_value); + Py_CLEAR(p->__pyx_v_c); + Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_11_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_11_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_11_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_13_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } - if (p->__pyx_v_value) { - e = (*v)(p->__pyx_v_value, a); if (e) return e; + if (p->__pyx_v_c) { + e = (*v)(p->__pyx_v_c, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_11_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_13_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_11_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_11_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_13_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -41172,9 +43425,9 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -41192,7 +43445,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_11_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41207,7 +43460,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_ #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -41225,113 +43478,111 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_11_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12___call__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12___call__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12___call__[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12___call__]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_14_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_14_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_14_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___call__(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___call__) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_assigned_product); - Py_CLEAR(p->__pyx_v_target_value); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_c); + Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12___call__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_12___call__[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_12___call__++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_14_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_14_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12___call__(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } - if (p->__pyx_v_assigned_product) { - e = (*v)(p->__pyx_v_assigned_product, a); if (e) return e; + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } - if (p->__pyx_v_target_value) { - e = (*v)(p->__pyx_v_target_value, a); if (e) return e; + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_c) { + e = (*v)(p->__pyx_v_c, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; } - return 0; -} - -static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_12___call__(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__ *)o; - tmp = ((PyObject*)p->__pyx_v_assigned_product); - p->__pyx_v_assigned_product = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_target_value); - p->__pyx_v_target_value = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call___slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___call__}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12___call__}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_12___call__}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12___call__}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_14_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call___spec = { - "constraint.constraints.__pyx_scope_struct_12___call__", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_14_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call___slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__ = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_12___call__", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_12___call__), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_14_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_12___call__, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_genexpr, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -41345,10 +43596,10 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_12___call__, /*tp_traverse*/ - __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_12___call__, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_14_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -41365,7 +43616,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_12___call__, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41380,7 +43631,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_ #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -41398,108 +43649,109 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_12_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_15___call__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_13_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_15___call__ > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_15___call__[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_15___call__]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15___call__(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15___call__) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_c); - Py_CLEAR(p->__pyx_t_0); + Py_CLEAR(p->__pyx_v_target_value); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_13_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_13_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_15___call__ < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_15___call__[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_15___call__++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_15___call__(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_genexpr_arg_0) { - e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; - } - if (p->__pyx_v_c) { - e = (*v)(p->__pyx_v_c, a); if (e) return e; - } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; + if (p->__pyx_v_target_value) { + e = (*v)(p->__pyx_v_target_value, a); if (e) return e; } return 0; } + +static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_15___call__(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__ *)o; + tmp = ((PyObject*)p->__pyx_v_target_value); + p->__pyx_v_target_value = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_15___call___slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15___call__}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_15___call__}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_15___call__}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_15___call__}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_13_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_15___call___spec = { + "constraint.constraints.__pyx_scope_struct_15___call__", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_15___call___slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15___call__ = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_13_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_13_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_15___call__", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15___call__), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15___call__, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -41513,10 +43765,10 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_15___call__, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_15___call__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -41533,7 +43785,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_13_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_15___call__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41548,7 +43800,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_ #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -41566,33 +43818,36 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_13_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_16_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_14_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_14_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_14_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_16_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_16_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_16_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_genexpr) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -41600,28 +43855,32 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_ge PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_c); - Py_CLEAR(p->__pyx_t_0); + Py_CLEAR(p->__pyx_v_p); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_14_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_14_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_16_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_16_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_16_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_16_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -41632,42 +43891,34 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_14_ge if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } - if (p->__pyx_v_c) { - e = (*v)(p->__pyx_v_c, a); if (e) return e; - } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; + if (p->__pyx_v_p) { + e = (*v)(p->__pyx_v_p, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_14_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_16_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_16_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_14_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_16_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_14_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_14_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_16_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_14_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16_genexpr, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -41681,9 +43932,9 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_14_ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_14_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_16_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -41701,7 +43952,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_14_ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_14_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_16_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41716,7 +43967,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_14_ #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -41734,104 +43985,103 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_14_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_15_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_15_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_15_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_15_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_17_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_17_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_17_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_genexpr) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_c); + Py_CLEAR(p->__pyx_v_value); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_15_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_15_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_15_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_17_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_17_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_17_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_15_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; - } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } - if (p->__pyx_v_c) { - e = (*v)(p->__pyx_v_c, a); if (e) return e; + if (p->__pyx_v_value) { + e = (*v)(p->__pyx_v_value, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_15_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_15_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_15_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_17_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_15_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_15_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_17_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_15_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_genexpr, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -41845,9 +44095,9 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_15_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -41865,7 +44115,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_15_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -41880,7 +44130,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_ #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -41898,106 +44148,103 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_15_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_16___call__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_18_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_16___call__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_16___call__[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_16___call__]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_18_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_18_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_18_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16___call__(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16___call__) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_target_value); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_value); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_16___call__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_16___call__[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_16___call__++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_18_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_18_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_18_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_16___call__(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_18_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } - if (p->__pyx_v_target_value) { - e = (*v)(p->__pyx_v_target_value, a); if (e) return e; + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_value) { + e = (*v)(p->__pyx_v_value, a); if (e) return e; } - return 0; -} - -static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_16___call__(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__ *)o; - tmp = ((PyObject*)p->__pyx_v_target_value); - p->__pyx_v_target_value = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_16___call___slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16___call__}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_16___call__}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_16___call__}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_16___call__}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_18_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_18_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_16___call___spec = { - "constraint.constraints.__pyx_scope_struct_16___call__", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_18_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_16___call___slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16___call__ = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_16___call__", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_16___call__), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_18_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_16___call__, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_genexpr, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -42011,10 +44258,10 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16_ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_16___call__, /*tp_traverse*/ - __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_16___call__, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_18_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -42031,7 +44278,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16_ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_16___call__, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_18_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -42046,7 +44293,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16_ #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -42064,104 +44311,109 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_16_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19___call__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_17_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_17_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_17_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19___call__ > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_19___call__[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19___call__]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19___call__(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_genexpr) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19___call__) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_outer_scope); - Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_p); + Py_CLEAR(p->__pyx_v_target_value); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_17_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_17_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_17_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19___call__ < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_19___call__[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19___call__++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_19___call__(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } - if (p->__pyx_outer_scope) { - e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; - } - if (p->__pyx_genexpr_arg_0) { - e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; - } - if (p->__pyx_v_p) { - e = (*v)(p->__pyx_v_p, a); if (e) return e; + if (p->__pyx_v_target_value) { + e = (*v)(p->__pyx_v_target_value, a); if (e) return e; } return 0; } + +static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_19___call__(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)o; + tmp = ((PyObject*)p->__pyx_v_target_value); + p->__pyx_v_target_value = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_19___call___slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19___call__}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_19___call__}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_19___call__}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19___call__}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_17_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_19___call___spec = { + "constraint.constraints.__pyx_scope_struct_19___call__", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_19___call___slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19___call__ = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_17_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_17_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_19___call__", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_17_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19___call__, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -42175,10 +44427,10 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17_ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_17_genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_19___call__, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_19___call__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -42195,7 +44447,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17_ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_17_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19___call__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -42210,7 +44462,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17_ #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -42228,100 +44480,107 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_17_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_18_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_20_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_18_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_18_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_18_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_20_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_20_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_20_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_genexpr) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_value); + Py_CLEAR(p->__pyx_v_p); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_18_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_18_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_18_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_20_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_20_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_20_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_18_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_20_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } - if (p->__pyx_v_value) { - e = (*v)(p->__pyx_v_value, a); if (e) return e; + if (p->__pyx_v_p) { + e = (*v)(p->__pyx_v_p, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_18_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_18_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_20_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_20_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_18_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_20_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_18_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_18_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_20_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_18_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_genexpr, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -42335,9 +44594,9 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_18_ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_18_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_20_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -42355,7 +44614,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_18_ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_18_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_20_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -42370,7 +44629,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_18_ #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -42388,106 +44647,116 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_18_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19___call__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19___call__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_19___call__[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19___call__]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19___call__(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19___call__) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_target_value); + Py_CLEAR(p->__pyx_v_values); + Py_CLEAR(p->__pyx_v_variable); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19___call__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_19___call__[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_19___call__++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_19___call__(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; } - if (p->__pyx_v_target_value) { - e = (*v)(p->__pyx_v_target_value, a); if (e) return e; + if (p->__pyx_v_values) { + e = (*v)(p->__pyx_v_values, a); if (e) return e; + } + if (p->__pyx_v_variable) { + e = (*v)(p->__pyx_v_variable, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_19___call__(PyObject *o) { +static int __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__ *)o; - tmp = ((PyObject*)p->__pyx_v_target_value); - p->__pyx_v_target_value = Py_None; Py_INCREF(Py_None); + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars *)o; + tmp = ((PyObject*)p->__pyx_v_values); + p->__pyx_v_values = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_variable); + p->__pyx_v_variable = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_19___call___slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19___call__}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_19___call__}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_19___call__}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19___call__}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_19___call___spec = { - "constraint.constraints.__pyx_scope_struct_19___call__", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars_spec = { + "constraint.constraints.__pyx_scope_struct_21_sum_other_vars", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_19___call___slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19___call__ = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_19___call__", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_19___call__), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_21_sum_other_vars", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_19___call__, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -42501,10 +44770,10 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19_ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_19___call__, /*tp_traverse*/ - __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_19___call__, /*tp_clear*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -42521,7 +44790,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19_ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_19___call__, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -42536,7 +44805,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19_ #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -42554,33 +44823,36 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_19_ }; #endif -static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_20_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_22_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_20_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_20_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_20_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_22_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_22_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_22_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_22_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_genexpr) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_22_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -42588,27 +44860,33 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_ge PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_p); + Py_CLEAR(p->__pyx_v_v); + Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_20_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_20_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_20_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_22_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_22_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_22_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_20_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_22_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr *)o; + struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -42619,39 +44897,37 @@ static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_20_ge if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } - if (p->__pyx_v_p) { - e = (*v)(p->__pyx_v_p, a); if (e) return e; + if (p->__pyx_v_v) { + e = (*v)(p->__pyx_v_v, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_20_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_20_genexpr}, +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_scope_struct_22_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_22_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_22_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_22_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr_spec = { - "constraint.constraints.__pyx_scope_struct_20_genexpr", - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr), +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_scope_struct_22_genexpr_spec = { + "constraint.constraints.__pyx_scope_struct_22_genexpr", + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_11constraints___pyx_scope_struct_22_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr = { +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_22_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.constraints.""__pyx_scope_struct_20_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_20_genexpr), /*tp_basicsize*/ + "constraint.constraints.""__pyx_scope_struct_22_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_22_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_20_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_22_genexpr, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -42665,9 +44941,9 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_20_ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_20_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_22_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -42685,7 +44961,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_20_ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_20_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_11constraints___pyx_scope_struct_22_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -42700,7 +44976,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_20_ #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -42772,15 +45048,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_defaults_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 64, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_defaults_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_defaults_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 65, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_defaults_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults) < (0)) __PYX_ERR(0, 65, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults = &__pyx_type_10constraint_11constraints___pyx_defaults; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults) < (0)) __PYX_ERR(0, 65, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults->tp_getattro == PyObject_GenericGetAttr)) { @@ -42788,15 +45067,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr)) __PYX_ERR(0, 393, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr)) __PYX_ERR(0, 433, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr) < (0)) __PYX_ERR(0, 433, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 393, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr) < (0)) __PYX_ERR(0, 433, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -42804,15 +45086,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess)) __PYX_ERR(0, 396, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess) < 0) __PYX_ERR(0, 396, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess)) __PYX_ERR(0, 436, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess) < (0)) __PYX_ERR(0, 436, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess = &__pyx_type_10constraint_11constraints___pyx_scope_struct_1_preProcess; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess) < 0) __PYX_ERR(0, 396, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess) < (0)) __PYX_ERR(0, 436, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_preProcess->tp_getattro == PyObject_GenericGetAttr)) { @@ -42820,15 +45105,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 410, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 450, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(0, 450, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_2_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 410, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(0, 450, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -42836,15 +45124,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 411, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 451, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(0, 451, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_3_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 411, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(0, 451, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -42852,15 +45143,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 540, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 615, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(0, 615, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_4_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 540, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(0, 615, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -42868,15 +45162,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess)) __PYX_ERR(0, 543, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess) < 0) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess)) __PYX_ERR(0, 618, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess) < (0)) __PYX_ERR(0, 618, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess = &__pyx_type_10constraint_11constraints___pyx_scope_struct_5_preProcess; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess) < 0) __PYX_ERR(0, 543, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess) < (0)) __PYX_ERR(0, 618, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_5_preProcess->tp_getattro == PyObject_GenericGetAttr)) { @@ -42884,15 +45181,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr)) __PYX_ERR(0, 551, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr)) __PYX_ERR(0, 626, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr) < (0)) __PYX_ERR(0, 626, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_6_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 551, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr) < (0)) __PYX_ERR(0, 626, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_6_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -42900,15 +45200,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr)) __PYX_ERR(0, 614, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 614, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr)) __PYX_ERR(0, 794, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr) < (0)) __PYX_ERR(0, 794, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_7_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 614, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr) < (0)) __PYX_ERR(0, 794, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_7_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -42916,47 +45219,56 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr)) __PYX_ERR(0, 710, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_8_preProcess_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess)) __PYX_ERR(0, 797, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_8_preProcess_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess) < (0)) __PYX_ERR(0, 797, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_8_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess = &__pyx_type_10constraint_11constraints___pyx_scope_struct_8_preProcess; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 710, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess) < (0)) __PYX_ERR(0, 797, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess); #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_genexpr->tp_getattro = PyObject_GenericGetAttr; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_8_preProcess->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess)) __PYX_ERR(0, 713, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess) < 0) __PYX_ERR(0, 713, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_9_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr)) __PYX_ERR(0, 805, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_9_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr) < (0)) __PYX_ERR(0, 805, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess = &__pyx_type_10constraint_11constraints___pyx_scope_struct_9_preProcess; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_9_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess) < 0) __PYX_ERR(0, 713, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr) < (0)) __PYX_ERR(0, 805, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_preProcess->tp_getattro = PyObject_GenericGetAttr; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_9_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr)) __PYX_ERR(0, 721, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 721, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr)) __PYX_ERR(0, 870, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr) < (0)) __PYX_ERR(0, 870, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_10_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 721, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr) < (0)) __PYX_ERR(0, 870, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_10_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -42964,15 +45276,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr)) __PYX_ERR(0, 780, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr) < 0) __PYX_ERR(0, 780, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr)) __PYX_ERR(0, 899, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr) < (0)) __PYX_ERR(0, 899, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_11_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr) < 0) __PYX_ERR(0, 780, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr) < (0)) __PYX_ERR(0, 899, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_11_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -42980,15 +45295,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_12___call___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__)) __PYX_ERR(0, 890, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_12___call___spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__) < 0) __PYX_ERR(0, 890, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_12___call___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__)) __PYX_ERR(0, 990, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_12___call___spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__) < (0)) __PYX_ERR(0, 990, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_12___call__; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__) < 0) __PYX_ERR(0, 890, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__) < (0)) __PYX_ERR(0, 990, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_12___call__->tp_getattro == PyObject_GenericGetAttr)) { @@ -42996,15 +45314,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr)) __PYX_ERR(0, 913, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr)) __PYX_ERR(0, 1013, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr) < (0)) __PYX_ERR(0, 1013, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_13_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(0, 913, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr) < (0)) __PYX_ERR(0, 1013, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_13_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -43012,15 +45333,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr)) __PYX_ERR(0, 914, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr)) __PYX_ERR(0, 1014, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr) < (0)) __PYX_ERR(0, 1014, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_14_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 914, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr) < (0)) __PYX_ERR(0, 1014, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_14_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -43028,47 +45352,56 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr)) __PYX_ERR(0, 928, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(0, 928, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_15___call___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__)) __PYX_ERR(0, 1146, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_15___call___spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__) < (0)) __PYX_ERR(0, 1146, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_15_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_15___call__; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(0, 928, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__) < (0)) __PYX_ERR(0, 1146, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__); #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15_genexpr->tp_getattro = PyObject_GenericGetAttr; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_15___call__->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_16___call___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__)) __PYX_ERR(0, 1034, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_16___call___spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__) < 0) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr)) __PYX_ERR(0, 1182, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr) < (0)) __PYX_ERR(0, 1182, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_16___call__; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_16_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__) < 0) __PYX_ERR(0, 1034, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr) < (0)) __PYX_ERR(0, 1182, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16___call__->tp_getattro = PyObject_GenericGetAttr; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_16_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr)) __PYX_ERR(0, 1070, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr) < 0) __PYX_ERR(0, 1070, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr)) __PYX_ERR(0, 1222, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr) < (0)) __PYX_ERR(0, 1222, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_17_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr) < 0) __PYX_ERR(0, 1070, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr) < (0)) __PYX_ERR(0, 1222, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_17_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -43076,15 +45409,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr)) __PYX_ERR(0, 1104, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr) < 0) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr)) __PYX_ERR(0, 1251, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr) < (0)) __PYX_ERR(0, 1251, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_18_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr) < 0) __PYX_ERR(0, 1104, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr) < (0)) __PYX_ERR(0, 1251, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_18_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -43092,15 +45428,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_19___call___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__)) __PYX_ERR(0, 1205, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_19___call___spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__) < 0) __PYX_ERR(0, 1205, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_19___call___spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__)) __PYX_ERR(0, 1333, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_19___call___spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__) < (0)) __PYX_ERR(0, 1333, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__ = &__pyx_type_10constraint_11constraints___pyx_scope_struct_19___call__; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__) < 0) __PYX_ERR(0, 1205, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__) < (0)) __PYX_ERR(0, 1333, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_19___call__->tp_getattro == PyObject_GenericGetAttr)) { @@ -43108,21 +45447,62 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr)) __PYX_ERR(0, 1241, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr) < 0) __PYX_ERR(0, 1241, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr)) __PYX_ERR(0, 1369, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr) < (0)) __PYX_ERR(0, 1369, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_20_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr) < 0) __PYX_ERR(0, 1241, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr) < (0)) __PYX_ERR(0, 1369, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_20_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars)) __PYX_ERR(0, 1571, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars) < (0)) __PYX_ERR(0, 1571, __pyx_L1_error) + #else + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars = &__pyx_type_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars) < (0)) __PYX_ERR(0, 1571, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars); + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_21_sum_other_vars->tp_getattro = PyObject_GenericGetAttr; + } + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_22_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr)) __PYX_ERR(0, 1573, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_22_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr) < (0)) __PYX_ERR(0, 1573, __pyx_L1_error) + #else + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_22_genexpr; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr) < (0)) __PYX_ERR(0, 1573, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr); + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_22_genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -43164,7 +45544,7 @@ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_constraints}, #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - {Py_mod_gil, Py_MOD_GIL_USED}, + {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE}, #endif #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, @@ -43226,7 +45606,8 @@ __Pyx_PyMODINIT_FUNC PyInit_constraints(void) return PyModuleDef_Init(&__pyx_moduledef); } /* ModuleCreationPEP489 */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ + || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { { PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think @@ -43256,12 +45637,15 @@ static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { #if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { static PY_INT64_T main_interpreter_id = -1; -#if CYTHON_COMPILING_IN_GRAAL +#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 + PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#elif CYTHON_COMPILING_IN_GRAAL PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000 - PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API +#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ + || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#elif CYTHON_COMPILING_IN_LIMITED_API + PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); #else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); #endif @@ -43333,11 +45717,12 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_constraints(PyObject *__pyx_pyinit __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -43380,48 +45765,28 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_constraints(PyObject *__pyx_pyinit if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /* ImportRefnannyAPI */ #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - -__Pyx_RefNannySetupContext("PyInit_constraints", 0); - if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } #endif + +__Pyx_RefNannySetupContext("PyInit_constraints", 0); + __Pyx_init_runtime_version(); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Library function declarations ---*/ /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED) - if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ + if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error) if (__pyx_module_is_main_constraint__constraints) { - if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) } { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -43430,10 +45795,10 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); } } /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(__pyx_mstate); (void)__Pyx_modinit_variable_export_code(__pyx_mstate); @@ -43447,2024 +45812,2315 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); /* "constraint/constraints.py":3 * """Module containing the code for constraint definitions.""" * - * from constraint.domain import Unassigned # <<<<<<<<<<<<<< - * from typing import Callable, Union, Optional - * from collections.abc import Sequence + * from collections.abc import Callable, Sequence # <<<<<<<<<<<<<< + * from itertools import product + * */ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Callable,__pyx_mstate_global->__pyx_n_u_Sequence}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_imported_names, 2, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Unassigned, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Callable,__pyx_mstate_global->__pyx_n_u_Sequence}; + for (__pyx_t_3=0; __pyx_t_3 < 2; __pyx_t_3++) { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/constraints.py":4 * + * from collections.abc import Callable, Sequence + * from itertools import product # <<<<<<<<<<<<<< + * * from constraint.domain import Unassigned - * from typing import Callable, Union, Optional # <<<<<<<<<<<<<< - * from collections.abc import Sequence - * from itertools import product */ - __pyx_t_3 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_Callable, __pyx_mstate_global->__pyx_n_u_Union, __pyx_mstate_global->__pyx_n_u_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_product}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_itertools, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Callable, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Union, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_product}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":5 - * from constraint.domain import Unassigned - * from typing import Callable, Union, Optional - * from collections.abc import Sequence # <<<<<<<<<<<<<< + /* "constraint/constraints.py":6 * from itertools import product * -*/ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Sequence); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Sequence); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Sequence, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":6 - * from typing import Callable, Union, Optional - * from collections.abc import Sequence - * from itertools import product # <<<<<<<<<<<<<< + * from constraint.domain import Unassigned # <<<<<<<<<<<<<< + * * - * class Constraint: */ - __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_itertools, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Unassigned}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_product); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_product, __pyx_t_3) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Unassigned}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":8 - * from itertools import product + /* "constraint/constraints.py":9 + * * * class Constraint: # <<<<<<<<<<<<<< * """Abstract base class for constraints.""" * */ - __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_n_u_Constraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Abstract_base_class_for_constrai); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_n_u_Constraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Abstract_base_class_for_constrai); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "constraint/constraints.py":11 + /* "constraint/constraints.py":12 * """Abstract base class for constraints.""" * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< * """Perform the constraint checking. * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 11, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 11, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 11, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_1__call__, 0, __pyx_mstate_global->__pyx_n_u_Constraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 12, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 12, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_1__call__, 0, __pyx_mstate_global->__pyx_n_u_Constraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < (0)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":36 + /* "constraint/constraints.py":37 * return True * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Preprocess variable domains. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_Constraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_Constraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":64 + /* "constraint/constraints.py":65 * vconstraints[variable].remove((self, variables)) * * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< * """Helper method for generic forward checking. * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 64, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_5forwardCheck, 0, __pyx_mstate_global->__pyx_n_u_Constraint_forwardCheck, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 64, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 65, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_5forwardCheck, 0, __pyx_mstate_global->__pyx_n_u_Constraint_forwardCheck, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_4)->arg0 = __pyx_t_5; - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_10constraint_11constraints___defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_forwardCheck, __pyx_t_4) < 0) __PYX_ERR(0, 64, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_5)->arg0 = __pyx_t_6; + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_10constraint_11constraints_2__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_forwardCheck, __pyx_t_5) < (0)) __PYX_ERR(0, 65, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":8 - * from itertools import product + /* "constraint/constraints.py":9 + * * * class Constraint: # <<<<<<<<<<<<<< * """Abstract base class for constraints.""" * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_t_4) < 0) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_t_5) < (0)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":105 + /* "constraint/constraints.py":106 * * * class FunctionConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint which wraps a function defining the constraint logic. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_which_wraps_a_functio); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_2 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_which_wraps_a_functio); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_2 != __pyx_t_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 106, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":126 + /* "constraint/constraints.py":134 * """ * * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_func, __pyx_mstate_global->__pyx_n_u_Callable) < 0) __PYX_ERR(0, 126, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assigned, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 126, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18FunctionConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_FunctionConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[2]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 126, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_func, __pyx_mstate_global->__pyx_n_u_Callable) < (0)) __PYX_ERR(0, 134, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_assigned, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18FunctionConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_FunctionConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_8) < (0)) __PYX_ERR(0, 134, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/constraints.py":138 + /* "constraint/constraints.py":146 * self._assigned = assigned * * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 138, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 138, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 138, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18FunctionConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_FunctionConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 146, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 146, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18FunctionConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_FunctionConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 146, __pyx_L1_error) - /* "constraint/constraints.py":144 + /* "constraint/constraints.py":152 * assignments: dict, * forwardcheck=False, * _unassigned=Unassigned, # <<<<<<<<<<<<<< * ): * # # initial code: 0.94621 seconds, Cythonized: 0.92805 seconds */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_4)->arg0 = __pyx_t_7; + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_5)->arg0 = __pyx_t_7; __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_10constraint_11constraints_2__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 138, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_10constraint_11constraints_4__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < (0)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":105 + /* "constraint/constraints.py":106 * * * class FunctionConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint which wraps a function defining the constraint logic. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_5) < (0)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":191 + /* "constraint/constraints.py":199 * return self._func(*parms) * * class CompilableFunctionConstraint(Constraint): # <<<<<<<<<<<<<< * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Wrapper_function_for_picklable_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Wrapper_function_for_picklable_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_2 != __pyx_t_3) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 191, __pyx_L1_error) + if (__pyx_t_2 != __pyx_t_4) { + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 199, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":194 + /* "constraint/constraints.py":202 * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" * * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 # <<<<<<<<<<<<<< * self._func = func * self._assigned = assigned */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_func, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 194, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_assigned, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 194, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint___i, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[2]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_func, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 202, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assigned, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint___i, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_t_8); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_7) < (0)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":198 + /* "constraint/constraints.py":206 * self._assigned = assigned * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") * */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint___c, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_6)->arg0 = __pyx_t_3; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_10constraint_11constraints_4__defaults__); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint___c, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_7)->arg0 = __pyx_t_4; + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_10constraint_11constraints_6__defaults__); + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_7) < (0)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":191 + /* "constraint/constraints.py":199 * return self._func(*parms) * * class CompilableFunctionConstraint(Constraint): # <<<<<<<<<<<<<< * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "constraint/constraints.py":202 - * - * - * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of all given variables are different. - * -*/ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_2 != __pyx_t_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 202, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "constraint/constraints.py":213 - * """ - * - * def __call__( # noqa: D102 # <<<<<<<<<<<<<< - * self, - * variables: Sequence, -*/ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 213, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 213, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 213, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22AllDifferentConstraint_1__call__, 0, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 213, __pyx_L1_error) - - /* "constraint/constraints.py":219 - * assignments: dict, - * forwardcheck=False, - * _unassigned=Unassigned, # <<<<<<<<<<<<<< - * ): - * seen = {} -*/ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_3)->arg0 = __pyx_t_7; - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10constraint_11constraints_6__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_3) < 0) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":202 - * - * - * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of all given variables are different. - * -*/ - __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "constraint/constraints.py":240 - * - * - * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of all given variables are equal. - * -*/ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_2 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 240, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "constraint/constraints.py":251 - * """ - * - * def __call__( # noqa: D102 # <<<<<<<<<<<<<< - * self, - * variables: Sequence, -*/ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 251, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 251, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 251, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18AllEqualConstraint_1__call__, 0, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 251, __pyx_L1_error) - - /* "constraint/constraints.py":257 - * assignments: dict, - * forwardcheck=False, - * _unassigned=Unassigned, # <<<<<<<<<<<<<< - * ): - * singlevalue = _unassigned -*/ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_5)->arg0 = __pyx_t_7; - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_10constraint_11constraints_8__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "constraint/constraints.py":240 - * - * - * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of all given variables are equal. - * -*/ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 240, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_7) < (0)) __PYX_ERR(0, 199, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":278 + /* "constraint/constraints.py":210 * * - * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables sum exactly to a given amount. + * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of all given variables are different. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_2 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 278, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 210, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":289 + /* "constraint/constraints.py":221 * """ * - * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. - * + * def __call__( # noqa: D102 # <<<<<<<<<<<<<< + * self, + * variables: Sequence, */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exactsum, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 289, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 289, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[3]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "constraint/constraints.py":301 - * self._multipliers = multipliers - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * multipliers = self._multipliers -*/ - __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 301, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 221, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 221, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22AllDifferentConstraint_1__call__, 0, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 301, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 301, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 301, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 301, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 301, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 221, __pyx_L1_error) - /* "constraint/constraints.py":318 - * domain.remove(value) - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * multipliers = self._multipliers - * exactsum = self._exactsum + /* "constraint/constraints.py":227 + * assignments: dict, + * forwardcheck=False, + * _unassigned=Unassigned, # <<<<<<<<<<<<<< + * ): + * seen = {} */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 318, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 318, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 318, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_4)->arg0 = __pyx_t_8; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_10constraint_11constraints_8__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 318, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < (0)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":278 + /* "constraint/constraints.py":210 * * - * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables sum exactly to a given amount. + * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of all given variables are different. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 278, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_t_4) < (0)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":366 - * return sum == exactsum + /* "constraint/constraints.py":248 * - * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that the sum of variables equals the value of another variable. + * + * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of all given variables are equal. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 366, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_the_su); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_2 != __pyx_t_3) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 366, __pyx_L1_error) + if (__pyx_t_2 != __pyx_t_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 248, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":377 + /* "constraint/constraints.py":259 * """ * - * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. - * + * def __call__( # noqa: D102 # <<<<<<<<<<<<<< + * self, + * variables: Sequence, */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 377, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < 0) __PYX_ERR(0, 377, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 377, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_26VariableExactSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint___ini_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 259, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 259, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18AllEqualConstraint_1__call__, 0, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 377, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 259, __pyx_L1_error) - /* "constraint/constraints.py":396 - * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * + /* "constraint/constraints.py":265 + * assignments: dict, + * forwardcheck=False, + * _unassigned=Unassigned, # <<<<<<<<<<<<<< + * ): + * singlevalue = _unassigned */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 396, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 396, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 396, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 396, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 396, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_26VariableExactSumConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint_prePr_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_6)->arg0 = __pyx_t_8; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_10constraint_11constraints_10__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < (0)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 396, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":418 - * domain.remove(value) - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * multipliers = self._multipliers + /* "constraint/constraints.py":248 * -*/ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 418, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 418, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 418, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_26VariableExactSumConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint___cal, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 418, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "constraint/constraints.py":366 - * return sum == exactsum * - * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that the sum of variables equals the value of another variable. + * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of all given variables are equal. * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 366, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_t_6) < (0)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":470 + /* "constraint/constraints.py":286 * * - * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables sum at least to a given amount. + * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables sum exactly to a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_2 != __pyx_t_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 470, __pyx_L1_error) + if (__pyx_t_2 != __pyx_t_7) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 286, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":481 + /* "constraint/constraints.py":302 * """ * - * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, exactsum: int | float, multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exactsum, __pyx_mstate_global->__pyx_kp_u_int_float) < (0)) __PYX_ERR(0, 302, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Sequence_None) < (0)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_minsum, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 481, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 481, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MinSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MinSumConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[3]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < (0)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 481, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/constraints.py":493 - * self._multipliers = multipliers + /* "constraint/constraints.py":317 + * self._var_is_negative = {} + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) +*/ + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 317, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 317, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 317, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_7) < (0)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "constraint/constraints.py":340 + * self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # check if each variable is in the assignments - * for variable in variables: + * multipliers = self._multipliers + * exactsum = self._exactsum */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 493, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 493, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 493, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MinSumConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_MinSumConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 340, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 340, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < (0)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":470 + /* "constraint/constraints.py":286 * * - * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables sum at least to a given amount. + * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables sum exactly to a given amount. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 470, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_5) < (0)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":513 - * return sum >= minsum + /* "constraint/constraints.py":399 + * return sum == exactsum * - * class VariableMinSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that the sum of variables sum at least to the value of another variable. + * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables equals the value of another variable. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_the_su_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_the_su); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 513, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 399, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":524 + /* "constraint/constraints.py":417 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 524, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < 0) __PYX_ERR(0, 524, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 524, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_24VariableMinSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint___init_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[3]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 417, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(0, 417, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Sequence_None) < (0)) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_26VariableExactSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint___ini_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[2]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 524, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_7) < (0)) __PYX_ERR(0, 417, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":543 + /* "constraint/constraints.py":436 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 543, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 543, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 543, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 543, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_24VariableMinSumConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint_preProc_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 436, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 436, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_26VariableExactSumConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint_prePr_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 543, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < (0)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":556 + /* "constraint/constraints.py":458 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 556, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 556, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 556, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_24VariableMinSumConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 458, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 458, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_26VariableExactSumConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint___cal, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_3) < 0) __PYX_ERR(0, 556, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_7) < (0)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":513 - * return sum >= minsum + /* "constraint/constraints.py":399 + * return sum == exactsum * - * class VariableMinSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that the sum of variables sum at least to the value of another variable. + * class VariableExactSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables equals the value of another variable. * */ - __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 513, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __pyx_t_7) < (0)) __PYX_ERR(0, 399, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":584 + /* "constraint/constraints.py":510 * * - * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables sum up to a given amount. + * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables sum at least to a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_2 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 510, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":595 + /* "constraint/constraints.py":526 * """ * - * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, minsum: int | float, multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_maxsum, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 595, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 595, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_minsum, __pyx_mstate_global->__pyx_kp_u_int_float) < (0)) __PYX_ERR(0, 526, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Sequence_None) < (0)) __PYX_ERR(0, 526, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MinSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MinSumConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[3]); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 595, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < (0)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":607 - * self._multipliers = multipliers + /* "constraint/constraints.py":539 + * self._var_max = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 607, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 607, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 607, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 607, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 607, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 539, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 539, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 539, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MinSumConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_MinSumConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 607, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < (0)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":642 - * domain.remove(value) + /* "constraint/constraints.py":555 + * self._var_max = { variable: max(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers - * maxsum = self._maxsum + * minsum = self._minsum */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 642, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 642, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 642, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 642, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 555, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 555, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MinSumConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_MinSumConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 642, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < (0)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":584 + /* "constraint/constraints.py":510 * * - * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables sum up to a given amount. + * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables sum at least to a given amount. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 584, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_4) < (0)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":683 - * + /* "constraint/constraints.py":582 + * return sum >= minsum or missing * - * class VariableMaxSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that the sum of variables sum at most to the value of another variable. + * class VariableMinSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables sum at least to the value of another variable. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_the_su_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_the_su_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_2 != __pyx_t_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 683, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 582, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":694 + /* "constraint/constraints.py":599 * """ # noqa: E501 * - * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 694, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < 0) __PYX_ERR(0, 694, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 694, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_24VariableMaxSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint___init_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 599, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(0, 599, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Sequence_None) < (0)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_24VariableMinSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint___init_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3]); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 694, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < (0)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":713 + /* "constraint/constraints.py":618 * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 713, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 713, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 713, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 713, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 713, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_24VariableMaxSumConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint_preProc_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 713, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 618, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 618, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 618, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_24VariableMinSumConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint_preProc_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 713, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < (0)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":726 + /* "constraint/constraints.py":631 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 726, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 726, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 726, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 726, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_24VariableMaxSumConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 726, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 631, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 631, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_24VariableMinSumConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 726, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < (0)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":683 + /* "constraint/constraints.py":582 + * return sum >= minsum or missing * - * - * class VariableMaxSumConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that the sum of variables sum at most to the value of another variable. + * class VariableMinSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables sum at least to the value of another variable. * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 683, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_t_6) < (0)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":754 + /* "constraint/constraints.py":659 * * - * class ExactProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product of exactly a given amount. + * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables sum up to a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_2 != __pyx_t_3) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 754, __pyx_L1_error) + if (__pyx_t_2 != __pyx_t_7) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 659, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":765 + /* "constraint/constraints.py":675 * """ * - * def __init__(self, exactprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate an ExactProdConstraint. + * def __init__(self, maxsum: int | float, multipliers: Sequence | None = None): # <<<<<<<<<<<<<< + * """Initialization method. * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exactprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 765, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19ExactProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 765, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_maxsum, __pyx_mstate_global->__pyx_kp_u_int_float) < (0)) __PYX_ERR(0, 675, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Sequence_None) < (0)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 765, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < (0)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":773 - * self._exactprod = exactprod + /* "constraint/constraints.py":689 + * self._var_is_negative = {} * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * + * multipliers = self._multipliers if self._multipliers else [1] * len(variables) */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 773, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 773, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 773, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 773, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 773, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19ExactProdConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 689, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 689, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 689, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 773, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_7) < (0)) __PYX_ERR(0, 689, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":801 - * domain.remove(value) + /* "constraint/constraints.py":707 + * self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * exactprod = self._exactprod - * prod = 1 + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers + * maxsum = self._maxsum */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 801, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 801, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 801, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 801, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19ExactProdConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 801, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 707, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 707, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 801, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < (0)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":754 + /* "constraint/constraints.py":659 * * - * class ExactProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product of exactly a given amount. + * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables sum up to a given amount. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 754, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_5) < (0)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":828 - * return True + /* "constraint/constraints.py":761 * - * class VariableExactProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that the product of variables equals the value of another variable. + * + * class VariableMaxSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables sum at most to the value of another variable. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 828, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 828, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 828, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 828, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_the_pr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_the_su_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 828, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 761, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":839 - * """ + /* "constraint/constraints.py":778 + * """ # noqa: E501 * - * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< - * """Instantiate a VariableExactProdConstraint. + * def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): # <<<<<<<<<<<<<< + * """Initialization method. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 839, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < 0) __PYX_ERR(0, 839, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_27VariableExactProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint___in, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 778, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sum_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(0, 778, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Sequence_None) < (0)) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_24VariableMaxSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint___init_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 778, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[2]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":849 - * self.product_vars = product_vars - * - * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< - * """Return min and max product of domains of product_vars (excluding `exclude_var` if given).""" - * bounds = [] -*/ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_27VariableExactProdConstraint_3_get_product_bounds, 0, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint__get, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[3]); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_3) < 0) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "constraint/constraints.py":869 - * return min(products), max(products) - * - * def _safe_product(self, values): # <<<<<<<<<<<<<< - * prod = 1 - * for v in values: -*/ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_27VariableExactProdConstraint_5_safe_product, 0, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint__saf, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 869, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_3) < 0) __PYX_ERR(0, 869, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_7) < (0)) __PYX_ERR(0, 778, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":875 - * return prod + /* "constraint/constraints.py":797 + * assert multipliers[-1] == 1, "Last multiplier must be 1, as it is the target variable." * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 875, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 875, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 875, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 875, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 875, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_27VariableExactProdConstraint_7preProcess, 0, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint_preP, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 797, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 797, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 797, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 797, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 797, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_24VariableMaxSumConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint_preProc_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 875, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < (0)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":890 - * domain.remove(value) + /* "constraint/constraints.py":810 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * multipliers = self._multipliers * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * if self.target_var not in assignments: - * return True */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 890, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 890, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 890, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_27VariableExactProdConstraint_9__call__, 0, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint___ca_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 810, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 810, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 810, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_24VariableMaxSumConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 810, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_3) < 0) __PYX_ERR(0, 890, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_7) < (0)) __PYX_ERR(0, 810, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":828 - * return True + /* "constraint/constraints.py":761 * - * class VariableExactProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that the product of variables equals the value of another variable. + * + * class VariableMaxSumConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the sum of variables sum at most to the value of another variable. * */ - __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 761, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_t_7) < (0)) __PYX_ERR(0, 761, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":936 + /* "constraint/constraints.py":838 * * - * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product up to at least a given amount. + * class ExactProdConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables create a product of exactly a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 936, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 936, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 936, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 838, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_2 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 936, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 838, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":947 + /* "constraint/constraints.py":854 * """ * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MinProdConstraint. + * def __init__(self, exactprod: int | float): # <<<<<<<<<<<<<< + * """Instantiate an ExactProdConstraint. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 947, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_minprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 947, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MinProdConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 947, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_exactprod, __pyx_mstate_global->__pyx_kp_u_int_float) < (0)) __PYX_ERR(0, 854, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19ExactProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 947, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < (0)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":955 - * self._minprod = minprod + /* "constraint/constraints.py":863 + * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 955, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 955, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 955, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 955, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_MinProdConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 955, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 863, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 863, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 863, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 863, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19ExactProdConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 955, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < (0)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":966 + /* "constraint/constraints.py":891 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # check if each variable is in the assignments - * for variable in variables: + * exactprod = self._exactprod + * prod = 1 */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 966, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 966, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 966, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 966, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_MinProdConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 891, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 891, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 891, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19ExactProdConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 966, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < (0)) __PYX_ERR(0, 891, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":936 + /* "constraint/constraints.py":838 * * - * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that values of given variables create a product up to at least a given amount. + * class ExactProdConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables create a product of exactly a given amount. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 936, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 936, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, __pyx_t_4) < (0)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":982 - * + /* "constraint/constraints.py":922 + * return True * - * class VariableMinProdConstraint(Constraint): # <<<<<<<<<<<<<< - * """Constraint enforcing that the product of variables is at least the value of another variable. + * class VariableExactProdConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the product of variables equals the value of another variable. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_the_pr_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 922, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_the_pr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_2 != __pyx_t_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 982, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 922, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":993 + /* "constraint/constraints.py":939 * """ * - * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< - * self.target_var = target_var - * self.product_vars = product_vars + * def __init__(self, target_var: str, product_vars: Sequence[str]): # <<<<<<<<<<<<<< + * """Instantiate a VariableExactProdConstraint. + * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 993, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < 0) __PYX_ERR(0, 993, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMinProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 993, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 939, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_27VariableExactProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint___in, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 993, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < (0)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":997 + /* "constraint/constraints.py":949 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< + * """Return min and max product of domains of product_vars (excluding `exclude_var` if given).""" * bounds = [] - * for var in self.product_vars: */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMinProdConstraint_3_get_product_bounds, 0, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint__get_p, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 997, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_27VariableExactProdConstraint_3_get_product_bounds, 0, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint__get, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3]); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_6) < 0) __PYX_ERR(0, 997, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[2]); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_6) < (0)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1015 + /* "constraint/constraints.py":969 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< * prod = 1 * for v in values: */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMinProdConstraint_5_safe_product, 0, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint__safe, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1015, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_27VariableExactProdConstraint_5_safe_product, 0, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint__saf, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_6) < 0) __PYX_ERR(0, 1015, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_6) < (0)) __PYX_ERR(0, 969, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1021 + /* "constraint/constraints.py":975 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * target_dom = domains[self.target_var] + * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1021, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1021, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1021, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 1021, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1021, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMinProdConstraint_7preProcess, 0, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint_prePro, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1021, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 975, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 975, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 975, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 975, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_27VariableExactProdConstraint_7preProcess, 0, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint_preP, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 1021, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < (0)) __PYX_ERR(0, 975, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":990 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * if self.target_var not in assignments: + * return True +*/ + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 990, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 990, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 990, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_27VariableExactProdConstraint_9__call__, 0, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint___ca_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < (0)) __PYX_ERR(0, 990, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + + /* "constraint/constraints.py":922 + * return True + * + * class VariableExactProdConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the product of variables equals the value of another variable. + * +*/ + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 922, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_t_6) < (0)) __PYX_ERR(0, 922, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":1037 + * + * + * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables create a product up to at least a given amount. + * +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_2 != __pyx_t_7) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 1037, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "constraint/constraints.py":1053 + * """ # noqa: E501 + * + * def __init__(self, minprod: int | float): # <<<<<<<<<<<<<< + * """Instantiate a MinProdConstraint. + * +*/ + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_minprod, __pyx_mstate_global->__pyx_kp_u_int_float) < (0)) __PYX_ERR(0, 1053, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MinProdConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1053, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < (0)) __PYX_ERR(0, 1053, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":1061 + * self._minprod = minprod + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * +*/ + __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1061, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1061, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 1061, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1061, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_MinProdConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_7) < (0)) __PYX_ERR(0, 1061, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "constraint/constraints.py":1072 + * domain.remove(value) + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< + * # check if each variable is in the assignments + * for variable in variables: +*/ + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1072, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1072, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1072, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1072, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_MinProdConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1072, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < (0)) __PYX_ERR(0, 1072, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + + /* "constraint/constraints.py":1037 + * + * + * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that values of given variables create a product up to at least a given amount. + * +*/ + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_5) < (0)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/constraints.py":1088 + * + * + * class VariableMinProdConstraint(Constraint): # <<<<<<<<<<<<<< + * """Constraint enforcing that the product of variables is at least the value of another variable. + * +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_the_pr_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_2 != __pyx_t_4) { + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1088, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/constraints.py":1105 + * """ + * + * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< + * self.target_var = target_var + * self.product_vars = product_vars +*/ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 1105, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(0, 1105, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMinProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_7) < (0)) __PYX_ERR(0, 1105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "constraint/constraints.py":1109 + * self.product_vars = product_vars + * + * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< + * bounds = [] + * for var in self.product_vars: +*/ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMinProdConstraint_3_get_product_bounds, 0, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint__get_p, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[2]); + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_7) < (0)) __PYX_ERR(0, 1109, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "constraint/constraints.py":1127 + * return min(products), max(products) + * + * def _safe_product(self, values): # <<<<<<<<<<<<<< + * prod = 1 + * for v in values: +*/ + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMinProdConstraint_5_safe_product, 0, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint__safe, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_7) < (0)) __PYX_ERR(0, 1127, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "constraint/constraints.py":1133 + * return prod + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< + * Constraint.preProcess(self, variables, domains, constraints, vconstraints) + * target_dom = domains[self.target_var] +*/ + __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1133, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1133, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 1133, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1133, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMinProdConstraint_7preProcess, 0, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint_prePro, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < (0)) __PYX_ERR(0, 1133, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1034 + /* "constraint/constraints.py":1146 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * if self.target_var not in assignments: * return True # Can't evaluate yet */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1034, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1034, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1034, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1034, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMinProdConstraint_9__call__, 0, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint___call_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1034, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 1034, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1146, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1146, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1146, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMinProdConstraint_9__call__, 0, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint___call_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_7) < (0)) __PYX_ERR(0, 1146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":982 + /* "constraint/constraints.py":1088 * * * class VariableMinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the product of variables is at least the value of another variable. * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 982, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 982, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_t_7) < (0)) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1078 + /* "constraint/constraints.py":1190 * * * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at most a given amount. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1078, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1078, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1078, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1078, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1078, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_2 != __pyx_t_3) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 1078, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_2 != __pyx_t_6) { + if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1190, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1089 + /* "constraint/constraints.py":1206 * """ * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< + * def __init__(self, maxprod: int | float): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1089, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_maxprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 1089, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1089, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 1089, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_maxprod, __pyx_mstate_global->__pyx_kp_u_int_float) < (0)) __PYX_ERR(0, 1206, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < (0)) __PYX_ERR(0, 1206, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1097 - * self._maxprod = maxprod + /* "constraint/constraints.py":1215 + * self._variable_contains_lt1: list[bool] = list() * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1097, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1097, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1097, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 1097, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1097, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1097, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_3) < 0) __PYX_ERR(0, 1097, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 1215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1215, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < (0)) __PYX_ERR(0, 1215, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1125 + /* "constraint/constraints.py":1243 * domain.remove(value) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * maxprod = self._maxprod * prod = 1 */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1125, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1125, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1125, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 1125, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1243, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1243, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1243, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < (0)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1078 + /* "constraint/constraints.py":1190 * * * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at most a given amount. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1078, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 1078, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_4) < (0)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1153 + /* "constraint/constraints.py":1275 * * * class VariableMaxProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the product of variables is at most the value of another variable. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_the_pr_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_2 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1153, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_the_pr_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_2 != __pyx_t_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 1275, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1164 + /* "constraint/constraints.py":1292 * """ # noqa: E501 * * def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 # <<<<<<<<<<<<<< * self.target_var = target_var * self.product_vars = product_vars */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 1164, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < 0) __PYX_ERR(0, 1164, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMaxProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_target_var, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 1292, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_product_vars, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(0, 1292, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMaxProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < (0)) __PYX_ERR(0, 1292, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1168 + /* "constraint/constraints.py":1296 * self.product_vars = product_vars * * def _get_product_bounds(self, domain_dict, exclude_var=None): # <<<<<<<<<<<<<< * bounds = [] * for var in self.product_vars: */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMaxProdConstraint_3_get_product_bounds, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint__get_p, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[3]); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_3) < 0) __PYX_ERR(0, 1168, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMaxProdConstraint_3_get_product_bounds, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint__get_p, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[2]); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_get_product_bounds, __pyx_t_6) < (0)) __PYX_ERR(0, 1296, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1186 + /* "constraint/constraints.py":1314 * return min(products), max(products) * * def _safe_product(self, values): # <<<<<<<<<<<<<< * prod = 1 * for v in values: */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMaxProdConstraint_5_safe_product, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint__safe, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1186, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_3) < 0) __PYX_ERR(0, 1186, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMaxProdConstraint_5_safe_product, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint__safe, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_safe_product, __pyx_t_6) < (0)) __PYX_ERR(0, 1314, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1192 + /* "constraint/constraints.py":1320 * return prod * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * target_dom = domains[self.target_var] */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1192, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1192, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 1192, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1192, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMaxProdConstraint_7preProcess, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint_prePro, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1192, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 1192, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1320, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1320, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 1320, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1320, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMaxProdConstraint_7preProcess, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint_prePro, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < (0)) __PYX_ERR(0, 1320, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1205 + /* "constraint/constraints.py":1333 * dom.remove(val) * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * if self.target_var not in assignments: * return True # Can't evaluate yet */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1205, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1205, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1205, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMaxProdConstraint_9__call__, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint___call_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_3) < 0) __PYX_ERR(0, 1205, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1333, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1333, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1333, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_25VariableMaxProdConstraint_9__call__, 0, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint___call_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < (0)) __PYX_ERR(0, 1333, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1153 + /* "constraint/constraints.py":1275 * * * class VariableMaxProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that the product of variables is at most the value of another variable. * */ - __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 1153, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __pyx_t_6) < (0)) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1249 + /* "constraint/constraints.py":1377 * * * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1249, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1249, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_mstate_global->__pyx_n_u_InSetConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_2 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1249, __pyx_L1_error) + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_mstate_global->__pyx_n_u_InSetConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_2 != __pyx_t_7) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 1377, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1260 + /* "constraint/constraints.py":1388 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_InSetConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 1260, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_InSetConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_7) < (0)) __PYX_ERR(0, 1388, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1268 + /* "constraint/constraints.py":1396 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # preProcess() will remove it. * raise RuntimeError("Can't happen") */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_InSetConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1]); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 1268, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_InSetConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[1]); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_7) < (0)) __PYX_ERR(0, 1396, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1272 + /* "constraint/constraints.py":1400 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * for variable in variables: */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1272, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1272, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 1272, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1272, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_5preProcess, 0, __pyx_mstate_global->__pyx_n_u_InSetConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 1272, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1400, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1400, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 1400, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1400, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_5preProcess, 0, __pyx_mstate_global->__pyx_n_u_InSetConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < (0)) __PYX_ERR(0, 1400, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1249 + /* "constraint/constraints.py":1377 * * * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1249, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 1249, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_5) < (0)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1283 + /* "constraint/constraints.py":1411 * * * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are not present in the given set. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_2 != __pyx_t_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_2 != __pyx_t_4) { + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1411, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1294 + /* "constraint/constraints.py":1422 * """ * * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 1294, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < (0)) __PYX_ERR(0, 1422, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1302 + /* "constraint/constraints.py":1430 * self._set = set * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # preProcess() will remove it. * raise RuntimeError("Can't happen") */ - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1302, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[1]); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 1302, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1]); + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < (0)) __PYX_ERR(0, 1430, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1306 + /* "constraint/constraints.py":1434 * raise RuntimeError("Can't happen") * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * for variable in variables: */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_5preProcess, 0, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1434, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1434, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 1434, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1434, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_5preProcess, 0, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1434, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_7) < (0)) __PYX_ERR(0, 1434, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/constraints.py":1283 + /* "constraint/constraints.py":1411 * * * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are not present in the given set. * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1411, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_7) < (0)) __PYX_ERR(0, 1411, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1317 + /* "constraint/constraints.py":1445 * * * class SomeInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that at least some of the values of given variables must be present in a given set. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1317, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_at_lea); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_2 != __pyx_t_3) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 1317, __pyx_L1_error) + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_at_lea); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_2 != __pyx_t_6) { + if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 1445, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1328 + /* "constraint/constraints.py":1456 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[4]); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 1328, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3]); + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < (0)) __PYX_ERR(0, 1456, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1342 + /* "constraint/constraints.py":1470 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1342, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1342, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1342, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1342, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 1342, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1470, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1470, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1470, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < (0)) __PYX_ERR(0, 1470, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/constraints.py":1317 + /* "constraint/constraints.py":1445 * * * class SomeInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that at least some of the values of given variables must be present in a given set. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1317, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 1317, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1445, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_4) < (0)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1379 + /* "constraint/constraints.py":1507 * * * class SomeNotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that at least some of the values of given variables must not be present in a given set. * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_at_lea_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_2 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 1379, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_at_lea_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_2 != __pyx_t_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 1507, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1390 + /* "constraint/constraints.py":1518 * """ * * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 1390, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[75])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[3]); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < (0)) __PYX_ERR(0, 1518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/constraints.py":1404 + /* "constraint/constraints.py":1532 * self._exact = exact * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 1404, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1404, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 1404, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1404, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_3) < 0) __PYX_ERR(0, 1404, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1532, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1532, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1532, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1532, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[76])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1532, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < (0)) __PYX_ERR(0, 1532, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/constraints.py":1379 + /* "constraint/constraints.py":1507 * * * class SomeNotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that at least some of the values of given variables must not be present in a given set. * */ - __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 1379, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_6) < (0)) __PYX_ERR(0, 1507, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/constraints.py":1 - * """Module containing the code for constraint definitions.""" # <<<<<<<<<<<<<< + /* "constraint/constraints.py":1571 + * # Utility functions * - * from constraint.domain import Unassigned + * def sum_other_vars(variables: Sequence, variable, values: dict): # <<<<<<<<<<<<<< + * """Calculate the sum of the given values of all other variables.""" + * return sum(values[v] for v in variables if v != variable) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 1571, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_values, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 1571, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_1sum_other_vars, 0, __pyx_mstate_global->__pyx_n_u_sum_other_vars, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[77])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sum_other_vars, __pyx_t_7) < (0)) __PYX_ERR(0, 1571, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "constraint/constraints.py":1 + * """Module containing the code for constraint definitions.""" # <<<<<<<<<<<<<< + * + * from collections.abc import Callable, Sequence +*/ + __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_7) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); if (__pyx_m) { if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init constraint.constraints", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -45492,337 +48148,27 @@ __Pyx_RefNannySetupContext("PyInit_constraints", 0); #endif } /* #### Code section: pystring_table ### */ - -typedef struct { - const char *s; -#if 645 <= 65535 - const unsigned short n; -#elif 645 / 2 < INT_MAX - const unsigned int n; -#elif 645 / 2 < LONG_MAX - const unsigned long n; -#else - const Py_ssize_t n; -#endif -#if 1 <= 31 - const unsigned int encoding : 5; -#elif 1 <= 255 - const unsigned char encoding; -#elif 1 <= 65535 - const unsigned short encoding; -#else - const Py_ssize_t encoding; -#endif - const unsigned int is_unicode : 1; - const unsigned int intern : 1; -} __Pyx_StringTabEntry; -static const char * const __pyx_string_tab_encodings[] = { 0 }; -static const __Pyx_StringTabEntry __pyx_string_tab[] = { - {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ - {__pyx_k_Abstract_base_class_for_constrai, sizeof(__pyx_k_Abstract_base_class_for_constrai), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Abstract_base_class_for_constrai */ - {__pyx_k_AllDifferentConstraint, sizeof(__pyx_k_AllDifferentConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllDifferentConstraint */ - {__pyx_k_AllDifferentConstraint___call, sizeof(__pyx_k_AllDifferentConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllDifferentConstraint___call */ - {__pyx_k_AllEqualConstraint, sizeof(__pyx_k_AllEqualConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllEqualConstraint */ - {__pyx_k_AllEqualConstraint___call, sizeof(__pyx_k_AllEqualConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllEqualConstraint___call */ - {__pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AssertionError */ - {__pyx_k_Callable, sizeof(__pyx_k_Callable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Callable */ - {__pyx_k_Can_t_happen, sizeof(__pyx_k_Can_t_happen), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Can_t_happen */ - {__pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CompilableFunctionConstraint */ - {__pyx_k_CompilableFunctionConstraint___c, sizeof(__pyx_k_CompilableFunctionConstraint___c), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CompilableFunctionConstraint___c */ - {__pyx_k_CompilableFunctionConstraint___i, sizeof(__pyx_k_CompilableFunctionConstraint___i), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CompilableFunctionConstraint___i */ - {__pyx_k_CompilableFunctionConstraint_can, sizeof(__pyx_k_CompilableFunctionConstraint_can), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CompilableFunctionConstraint_can */ - {__pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint */ - {__pyx_k_Constraint___call, sizeof(__pyx_k_Constraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint___call */ - {__pyx_k_Constraint_enforcing_that_at_lea, sizeof(__pyx_k_Constraint_enforcing_that_at_lea), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_at_lea */ - {__pyx_k_Constraint_enforcing_that_at_lea_2, sizeof(__pyx_k_Constraint_enforcing_that_at_lea_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_at_lea_2 */ - {__pyx_k_Constraint_enforcing_that_the_pr, sizeof(__pyx_k_Constraint_enforcing_that_the_pr), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_the_pr */ - {__pyx_k_Constraint_enforcing_that_the_pr_2, sizeof(__pyx_k_Constraint_enforcing_that_the_pr_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_the_pr_2 */ - {__pyx_k_Constraint_enforcing_that_the_pr_3, sizeof(__pyx_k_Constraint_enforcing_that_the_pr_3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_the_pr_3 */ - {__pyx_k_Constraint_enforcing_that_the_su, sizeof(__pyx_k_Constraint_enforcing_that_the_su), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_the_su */ - {__pyx_k_Constraint_enforcing_that_the_su_2, sizeof(__pyx_k_Constraint_enforcing_that_the_su_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_the_su_2 */ - {__pyx_k_Constraint_enforcing_that_the_su_3, sizeof(__pyx_k_Constraint_enforcing_that_the_su_3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_the_su_3 */ - {__pyx_k_Constraint_enforcing_that_values, sizeof(__pyx_k_Constraint_enforcing_that_values), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values */ - {__pyx_k_Constraint_enforcing_that_values_10, sizeof(__pyx_k_Constraint_enforcing_that_values_10), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_10 */ - {__pyx_k_Constraint_enforcing_that_values_2, sizeof(__pyx_k_Constraint_enforcing_that_values_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_2 */ - {__pyx_k_Constraint_enforcing_that_values_3, sizeof(__pyx_k_Constraint_enforcing_that_values_3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_3 */ - {__pyx_k_Constraint_enforcing_that_values_4, sizeof(__pyx_k_Constraint_enforcing_that_values_4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_4 */ - {__pyx_k_Constraint_enforcing_that_values_5, sizeof(__pyx_k_Constraint_enforcing_that_values_5), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_5 */ - {__pyx_k_Constraint_enforcing_that_values_6, sizeof(__pyx_k_Constraint_enforcing_that_values_6), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_6 */ - {__pyx_k_Constraint_enforcing_that_values_7, sizeof(__pyx_k_Constraint_enforcing_that_values_7), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_7 */ - {__pyx_k_Constraint_enforcing_that_values_8, sizeof(__pyx_k_Constraint_enforcing_that_values_8), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_8 */ - {__pyx_k_Constraint_enforcing_that_values_9, sizeof(__pyx_k_Constraint_enforcing_that_values_9), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_9 */ - {__pyx_k_Constraint_forwardCheck, sizeof(__pyx_k_Constraint_forwardCheck), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint_forwardCheck */ - {__pyx_k_Constraint_preProcess, sizeof(__pyx_k_Constraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint_preProcess */ - {__pyx_k_Constraint_which_wraps_a_functio, sizeof(__pyx_k_Constraint_which_wraps_a_functio), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_which_wraps_a_functio */ - {__pyx_k_ExactProdConstraint, sizeof(__pyx_k_ExactProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactProdConstraint */ - {__pyx_k_ExactProdConstraint___call, sizeof(__pyx_k_ExactProdConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactProdConstraint___call */ - {__pyx_k_ExactProdConstraint___init, sizeof(__pyx_k_ExactProdConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactProdConstraint___init */ - {__pyx_k_ExactProdConstraint_preProcess, sizeof(__pyx_k_ExactProdConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactProdConstraint_preProcess */ - {__pyx_k_ExactProdConstraint_preProcess_l, sizeof(__pyx_k_ExactProdConstraint_preProcess_l), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactProdConstraint_preProcess_l */ - {__pyx_k_ExactSumConstraint, sizeof(__pyx_k_ExactSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactSumConstraint */ - {__pyx_k_ExactSumConstraint___call, sizeof(__pyx_k_ExactSumConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactSumConstraint___call */ - {__pyx_k_ExactSumConstraint___init, sizeof(__pyx_k_ExactSumConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactSumConstraint___init */ - {__pyx_k_ExactSumConstraint_preProcess, sizeof(__pyx_k_ExactSumConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactSumConstraint_preProcess */ - {__pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionConstraint */ - {__pyx_k_FunctionConstraint___call, sizeof(__pyx_k_FunctionConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionConstraint___call */ - {__pyx_k_FunctionConstraint___init, sizeof(__pyx_k_FunctionConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionConstraint___init */ - {__pyx_k_InSetConstraint, sizeof(__pyx_k_InSetConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InSetConstraint */ - {__pyx_k_InSetConstraint___call, sizeof(__pyx_k_InSetConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InSetConstraint___call */ - {__pyx_k_InSetConstraint___init, sizeof(__pyx_k_InSetConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InSetConstraint___init */ - {__pyx_k_InSetConstraint_preProcess, sizeof(__pyx_k_InSetConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InSetConstraint_preProcess */ - {__pyx_k_Last_multiplier_must_be_1_as_it, sizeof(__pyx_k_Last_multiplier_must_be_1_as_it), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Last_multiplier_must_be_1_as_it */ - {__pyx_k_MaxProdConstraint, sizeof(__pyx_k_MaxProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint */ - {__pyx_k_MaxProdConstraint___call, sizeof(__pyx_k_MaxProdConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint___call */ - {__pyx_k_MaxProdConstraint___init, sizeof(__pyx_k_MaxProdConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint___init */ - {__pyx_k_MaxProdConstraint_preProcess, sizeof(__pyx_k_MaxProdConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint_preProcess */ - {__pyx_k_MaxProdConstraint_preProcess_loc, sizeof(__pyx_k_MaxProdConstraint_preProcess_loc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint_preProcess_loc */ - {__pyx_k_MaxSumConstraint, sizeof(__pyx_k_MaxSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxSumConstraint */ - {__pyx_k_MaxSumConstraint___call, sizeof(__pyx_k_MaxSumConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxSumConstraint___call */ - {__pyx_k_MaxSumConstraint___init, sizeof(__pyx_k_MaxSumConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxSumConstraint___init */ - {__pyx_k_MaxSumConstraint_preProcess, sizeof(__pyx_k_MaxSumConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxSumConstraint_preProcess */ - {__pyx_k_MaxSumConstraint_preProcess_loca, sizeof(__pyx_k_MaxSumConstraint_preProcess_loca), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxSumConstraint_preProcess_loca */ - {__pyx_k_MinProdConstraint, sizeof(__pyx_k_MinProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinProdConstraint */ - {__pyx_k_MinProdConstraint___call, sizeof(__pyx_k_MinProdConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinProdConstraint___call */ - {__pyx_k_MinProdConstraint___init, sizeof(__pyx_k_MinProdConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinProdConstraint___init */ - {__pyx_k_MinProdConstraint_preProcess, sizeof(__pyx_k_MinProdConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinProdConstraint_preProcess */ - {__pyx_k_MinSumConstraint, sizeof(__pyx_k_MinSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinSumConstraint */ - {__pyx_k_MinSumConstraint___call, sizeof(__pyx_k_MinSumConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinSumConstraint___call */ - {__pyx_k_MinSumConstraint___init, sizeof(__pyx_k_MinSumConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinSumConstraint___init */ - {__pyx_k_Multipliers_must_be_numbers, sizeof(__pyx_k_Multipliers_must_be_numbers), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Multipliers_must_be_numbers */ - {__pyx_k_Multipliers_must_match_sum_varia, sizeof(__pyx_k_Multipliers_must_match_sum_varia), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Multipliers_must_match_sum_varia */ - {__pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotImplementedError */ - {__pyx_k_NotInSetConstraint, sizeof(__pyx_k_NotInSetConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotInSetConstraint */ - {__pyx_k_NotInSetConstraint___call, sizeof(__pyx_k_NotInSetConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotInSetConstraint___call */ - {__pyx_k_NotInSetConstraint___init, sizeof(__pyx_k_NotInSetConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotInSetConstraint___init */ - {__pyx_k_NotInSetConstraint_preProcess, sizeof(__pyx_k_NotInSetConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotInSetConstraint_preProcess */ - {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ - {__pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Optional */ - {__pyx_k_Optional_Sequence, sizeof(__pyx_k_Optional_Sequence), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Optional_Sequence */ - {__pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RuntimeError */ - {__pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Sequence */ - {__pyx_k_Sequence_str, sizeof(__pyx_k_Sequence_str), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Sequence_str */ - {__pyx_k_SomeInSetConstraint, sizeof(__pyx_k_SomeInSetConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SomeInSetConstraint */ - {__pyx_k_SomeInSetConstraint___call, sizeof(__pyx_k_SomeInSetConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SomeInSetConstraint___call */ - {__pyx_k_SomeInSetConstraint___init, sizeof(__pyx_k_SomeInSetConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SomeInSetConstraint___init */ - {__pyx_k_SomeNotInSetConstraint, sizeof(__pyx_k_SomeNotInSetConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SomeNotInSetConstraint */ - {__pyx_k_SomeNotInSetConstraint___call, sizeof(__pyx_k_SomeNotInSetConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SomeNotInSetConstraint___call */ - {__pyx_k_SomeNotInSetConstraint___init, sizeof(__pyx_k_SomeNotInSetConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SomeNotInSetConstraint___init */ - {__pyx_k_Unassigned, sizeof(__pyx_k_Unassigned), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Unassigned */ - {__pyx_k_Union, sizeof(__pyx_k_Union), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Union */ - {__pyx_k_Union_int_float, sizeof(__pyx_k_Union_int_float), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Union_int_float */ - {__pyx_k_VariableExactProdConstraint, sizeof(__pyx_k_VariableExactProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactProdConstraint */ - {__pyx_k_VariableExactProdConstraint___ca, sizeof(__pyx_k_VariableExactProdConstraint___ca), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactProdConstraint___ca */ - {__pyx_k_VariableExactProdConstraint___ca_2, sizeof(__pyx_k_VariableExactProdConstraint___ca_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactProdConstraint___ca_2 */ - {__pyx_k_VariableExactProdConstraint___in, sizeof(__pyx_k_VariableExactProdConstraint___in), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactProdConstraint___in */ - {__pyx_k_VariableExactProdConstraint__get, sizeof(__pyx_k_VariableExactProdConstraint__get), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactProdConstraint__get */ - {__pyx_k_VariableExactProdConstraint__saf, sizeof(__pyx_k_VariableExactProdConstraint__saf), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactProdConstraint__saf */ - {__pyx_k_VariableExactProdConstraint_preP, sizeof(__pyx_k_VariableExactProdConstraint_preP), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactProdConstraint_preP */ - {__pyx_k_VariableExactSumConstraint, sizeof(__pyx_k_VariableExactSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactSumConstraint */ - {__pyx_k_VariableExactSumConstraint___cal, sizeof(__pyx_k_VariableExactSumConstraint___cal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactSumConstraint___cal */ - {__pyx_k_VariableExactSumConstraint___ini, sizeof(__pyx_k_VariableExactSumConstraint___ini), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactSumConstraint___ini */ - {__pyx_k_VariableExactSumConstraint___ini_2, sizeof(__pyx_k_VariableExactSumConstraint___ini_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactSumConstraint___ini_2 */ - {__pyx_k_VariableExactSumConstraint_prePr, sizeof(__pyx_k_VariableExactSumConstraint_prePr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactSumConstraint_prePr */ - {__pyx_k_VariableExactSumConstraint_prePr_2, sizeof(__pyx_k_VariableExactSumConstraint_prePr_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactSumConstraint_prePr_2 */ - {__pyx_k_VariableMaxProdConstraint, sizeof(__pyx_k_VariableMaxProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxProdConstraint */ - {__pyx_k_VariableMaxProdConstraint___call, sizeof(__pyx_k_VariableMaxProdConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxProdConstraint___call */ - {__pyx_k_VariableMaxProdConstraint___call_2, sizeof(__pyx_k_VariableMaxProdConstraint___call_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxProdConstraint___call_2 */ - {__pyx_k_VariableMaxProdConstraint___init, sizeof(__pyx_k_VariableMaxProdConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxProdConstraint___init */ - {__pyx_k_VariableMaxProdConstraint__get_p, sizeof(__pyx_k_VariableMaxProdConstraint__get_p), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxProdConstraint__get_p */ - {__pyx_k_VariableMaxProdConstraint__safe, sizeof(__pyx_k_VariableMaxProdConstraint__safe), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxProdConstraint__safe */ - {__pyx_k_VariableMaxProdConstraint_prePro, sizeof(__pyx_k_VariableMaxProdConstraint_prePro), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxProdConstraint_prePro */ - {__pyx_k_VariableMaxSumConstraint, sizeof(__pyx_k_VariableMaxSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxSumConstraint */ - {__pyx_k_VariableMaxSumConstraint___call, sizeof(__pyx_k_VariableMaxSumConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxSumConstraint___call */ - {__pyx_k_VariableMaxSumConstraint___init, sizeof(__pyx_k_VariableMaxSumConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxSumConstraint___init */ - {__pyx_k_VariableMaxSumConstraint___init_2, sizeof(__pyx_k_VariableMaxSumConstraint___init_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxSumConstraint___init_2 */ - {__pyx_k_VariableMaxSumConstraint_preProc, sizeof(__pyx_k_VariableMaxSumConstraint_preProc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxSumConstraint_preProc */ - {__pyx_k_VariableMaxSumConstraint_preProc_2, sizeof(__pyx_k_VariableMaxSumConstraint_preProc_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxSumConstraint_preProc_2 */ - {__pyx_k_VariableMinProdConstraint, sizeof(__pyx_k_VariableMinProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinProdConstraint */ - {__pyx_k_VariableMinProdConstraint___call, sizeof(__pyx_k_VariableMinProdConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinProdConstraint___call */ - {__pyx_k_VariableMinProdConstraint___call_2, sizeof(__pyx_k_VariableMinProdConstraint___call_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinProdConstraint___call_2 */ - {__pyx_k_VariableMinProdConstraint___init, sizeof(__pyx_k_VariableMinProdConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinProdConstraint___init */ - {__pyx_k_VariableMinProdConstraint__get_p, sizeof(__pyx_k_VariableMinProdConstraint__get_p), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinProdConstraint__get_p */ - {__pyx_k_VariableMinProdConstraint__safe, sizeof(__pyx_k_VariableMinProdConstraint__safe), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinProdConstraint__safe */ - {__pyx_k_VariableMinProdConstraint_prePro, sizeof(__pyx_k_VariableMinProdConstraint_prePro), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinProdConstraint_prePro */ - {__pyx_k_VariableMinSumConstraint, sizeof(__pyx_k_VariableMinSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinSumConstraint */ - {__pyx_k_VariableMinSumConstraint___call, sizeof(__pyx_k_VariableMinSumConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinSumConstraint___call */ - {__pyx_k_VariableMinSumConstraint___init, sizeof(__pyx_k_VariableMinSumConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinSumConstraint___init */ - {__pyx_k_VariableMinSumConstraint___init_2, sizeof(__pyx_k_VariableMinSumConstraint___init_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinSumConstraint___init_2 */ - {__pyx_k_VariableMinSumConstraint_preProc, sizeof(__pyx_k_VariableMinSumConstraint_preProc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinSumConstraint_preProc */ - {__pyx_k_VariableMinSumConstraint_preProc_2, sizeof(__pyx_k_VariableMinSumConstraint_preProc_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinSumConstraint_preProc_2 */ - {__pyx_k_Wrapper_function_for_picklable_s, sizeof(__pyx_k_Wrapper_function_for_picklable_s), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Wrapper_function_for_picklable_s */ - {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ - {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ - {__pyx_k_all_bounds, sizeof(__pyx_k_all_bounds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all_bounds */ - {__pyx_k_append, sizeof(__pyx_k_append), 0, 1, 1}, /* PyObject cname: __pyx_n_u_append */ - {__pyx_k_assigned, sizeof(__pyx_k_assigned), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assigned */ - {__pyx_k_assigned_2, sizeof(__pyx_k_assigned_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assigned_2 */ - {__pyx_k_assigned_prod, sizeof(__pyx_k_assigned_prod), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assigned_prod */ - {__pyx_k_assigned_product, sizeof(__pyx_k_assigned_product), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assigned_product */ - {__pyx_k_assignments, sizeof(__pyx_k_assignments), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assignments */ - {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */ - {__pyx_k_b, sizeof(__pyx_k_b), 0, 1, 1}, /* PyObject cname: __pyx_n_u_b */ - {__pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bool */ - {__pyx_k_bounds, sizeof(__pyx_k_bounds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bounds */ - {__pyx_k_c, sizeof(__pyx_k_c), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c */ - {__pyx_k_call, sizeof(__pyx_k_call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_call */ - {__pyx_k_candidates, sizeof(__pyx_k_candidates), 0, 1, 1}, /* PyObject cname: __pyx_n_u_candidates */ - {__pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class_getitem */ - {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ - {__pyx_k_close, sizeof(__pyx_k_close), 0, 1, 1}, /* PyObject cname: __pyx_n_u_close */ - {__pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_collections_abc */ - {__pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_constraints */ - {__pyx_k_constraint_constraints_py, sizeof(__pyx_k_constraint_constraints_py), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_constraint_constraints_py */ - {__pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_domain */ - {__pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraints */ - {__pyx_k_contains_lt1, sizeof(__pyx_k_contains_lt1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_contains_lt1 */ - {__pyx_k_contains_negative, sizeof(__pyx_k_contains_negative), 0, 1, 1}, /* PyObject cname: __pyx_n_u_contains_negative */ - {__pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict */ - {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */ - {__pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_doc */ - {__pyx_k_dom, sizeof(__pyx_k_dom), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dom */ - {__pyx_k_domain, sizeof(__pyx_k_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domain */ - {__pyx_k_domain_bounds, sizeof(__pyx_k_domain_bounds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domain_bounds */ - {__pyx_k_domain_dict, sizeof(__pyx_k_domain_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domain_dict */ - {__pyx_k_domains, sizeof(__pyx_k_domains), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domains */ - {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */ - {__pyx_k_exact, sizeof(__pyx_k_exact), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exact */ - {__pyx_k_exact_2, sizeof(__pyx_k_exact_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exact_2 */ - {__pyx_k_exactprod, sizeof(__pyx_k_exactprod), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exactprod */ - {__pyx_k_exactprod_2, sizeof(__pyx_k_exactprod_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exactprod_2 */ - {__pyx_k_exactsum, sizeof(__pyx_k_exactsum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exactsum */ - {__pyx_k_exactsum_2, sizeof(__pyx_k_exactsum_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exactsum_2 */ - {__pyx_k_exclude_var, sizeof(__pyx_k_exclude_var), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exclude_var */ - {__pyx_k_forwardCheck, sizeof(__pyx_k_forwardCheck), 0, 1, 1}, /* PyObject cname: __pyx_n_u_forwardCheck */ - {__pyx_k_forwardcheck, sizeof(__pyx_k_forwardcheck), 0, 1, 1}, /* PyObject cname: __pyx_n_u_forwardcheck */ - {__pyx_k_found, sizeof(__pyx_k_found), 0, 1, 1}, /* PyObject cname: __pyx_n_u_found */ - {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */ - {__pyx_k_func_2, sizeof(__pyx_k_func_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_2 */ - {__pyx_k_func_3, sizeof(__pyx_k_func_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_3 */ - {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */ - {__pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_genexpr */ - {__pyx_k_get, sizeof(__pyx_k_get), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get */ - {__pyx_k_get_product_bounds, sizeof(__pyx_k_get_product_bounds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_product_bounds */ - {__pyx_k_hi, sizeof(__pyx_k_hi), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hi */ - {__pyx_k_hideValue, sizeof(__pyx_k_hideValue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hideValue */ - {__pyx_k_index, sizeof(__pyx_k_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_index */ - {__pyx_k_init, sizeof(__pyx_k_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_init */ - {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */ - {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */ - {__pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 1, 1}, /* PyObject cname: __pyx_n_u_itertools */ - {__pyx_k_list_tuple, sizeof(__pyx_k_list_tuple), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_tuple */ - {__pyx_k_lo, sizeof(__pyx_k_lo), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lo */ - {__pyx_k_m, sizeof(__pyx_k_m), 0, 1, 1}, /* PyObject cname: __pyx_n_u_m */ - {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ - {__pyx_k_max, sizeof(__pyx_k_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max */ - {__pyx_k_max_others, sizeof(__pyx_k_max_others), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max_others */ - {__pyx_k_maxprod, sizeof(__pyx_k_maxprod), 0, 1, 1}, /* PyObject cname: __pyx_n_u_maxprod */ - {__pyx_k_maxprod_2, sizeof(__pyx_k_maxprod_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_maxprod_2 */ - {__pyx_k_maxsum, sizeof(__pyx_k_maxsum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_maxsum */ - {__pyx_k_maxsum_2, sizeof(__pyx_k_maxsum_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_maxsum_2 */ - {__pyx_k_maxval, sizeof(__pyx_k_maxval), 0, 1, 1}, /* PyObject cname: __pyx_n_u_maxval */ - {__pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaclass */ - {__pyx_k_min, sizeof(__pyx_k_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_min */ - {__pyx_k_min_others, sizeof(__pyx_k_min_others), 0, 1, 1}, /* PyObject cname: __pyx_n_u_min_others */ - {__pyx_k_minprod, sizeof(__pyx_k_minprod), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minprod */ - {__pyx_k_minprod_2, sizeof(__pyx_k_minprod_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minprod_2 */ - {__pyx_k_minsum, sizeof(__pyx_k_minsum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minsum */ - {__pyx_k_minsum_2, sizeof(__pyx_k_minsum_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minsum_2 */ - {__pyx_k_minval, sizeof(__pyx_k_minval), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minval */ - {__pyx_k_missing, sizeof(__pyx_k_missing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing */ - {__pyx_k_missing_lt1, sizeof(__pyx_k_missing_lt1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing_lt1 */ - {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ - {__pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mro_entries */ - {__pyx_k_multiplier, sizeof(__pyx_k_multiplier), 0, 1, 1}, /* PyObject cname: __pyx_n_u_multiplier */ - {__pyx_k_multipliers, sizeof(__pyx_k_multipliers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_multipliers */ - {__pyx_k_multipliers_2, sizeof(__pyx_k_multipliers_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_multipliers_2 */ - {__pyx_k_n, sizeof(__pyx_k_n), 0, 1, 1}, /* PyObject cname: __pyx_n_u_n */ - {__pyx_k_n_2, sizeof(__pyx_k_n_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_n_2 */ - {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ - {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */ - {__pyx_k_o, sizeof(__pyx_k_o), 0, 1, 1}, /* PyObject cname: __pyx_n_u_o */ - {__pyx_k_other_max, sizeof(__pyx_k_other_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_other_max */ - {__pyx_k_other_min, sizeof(__pyx_k_other_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_other_min */ - {__pyx_k_other_products, sizeof(__pyx_k_other_products), 0, 1, 1}, /* PyObject cname: __pyx_n_u_other_products */ - {__pyx_k_other_unassigned, sizeof(__pyx_k_other_unassigned), 0, 1, 1}, /* PyObject cname: __pyx_n_u_other_unassigned */ - {__pyx_k_others, sizeof(__pyx_k_others), 0, 1, 1}, /* PyObject cname: __pyx_n_u_others */ - {__pyx_k_others_bounds, sizeof(__pyx_k_others_bounds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_others_bounds */ - {__pyx_k_others_max, sizeof(__pyx_k_others_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_others_max */ - {__pyx_k_others_min, sizeof(__pyx_k_others_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_others_min */ - {__pyx_k_p, sizeof(__pyx_k_p), 0, 1, 1}, /* PyObject cname: __pyx_n_u_p */ - {__pyx_k_parms, sizeof(__pyx_k_parms), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parms */ - {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ - {__pyx_k_possible_max, sizeof(__pyx_k_possible_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_possible_max */ - {__pyx_k_possible_min, sizeof(__pyx_k_possible_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_possible_min */ - {__pyx_k_possible_prods, sizeof(__pyx_k_possible_prods), 0, 1, 1}, /* PyObject cname: __pyx_n_u_possible_prods */ - {__pyx_k_preProcess, sizeof(__pyx_k_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_preProcess */ - {__pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prepare */ - {__pyx_k_prod, sizeof(__pyx_k_prod), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prod */ - {__pyx_k_prods, sizeof(__pyx_k_prods), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prods */ - {__pyx_k_product, sizeof(__pyx_k_product), 0, 1, 1}, /* PyObject cname: __pyx_n_u_product */ - {__pyx_k_product_vars, sizeof(__pyx_k_product_vars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_product_vars */ - {__pyx_k_products, sizeof(__pyx_k_products), 0, 1, 1}, /* PyObject cname: __pyx_n_u_products */ - {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ - {__pyx_k_remove, sizeof(__pyx_k_remove), 0, 1, 1}, /* PyObject cname: __pyx_n_u_remove */ - {__pyx_k_round, sizeof(__pyx_k_round), 0, 1, 1}, /* PyObject cname: __pyx_n_u_round */ - {__pyx_k_safe_product, sizeof(__pyx_k_safe_product), 0, 1, 1}, /* PyObject cname: __pyx_n_u_safe_product */ - {__pyx_k_seen, sizeof(__pyx_k_seen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seen */ - {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */ - {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */ - {__pyx_k_set, sizeof(__pyx_k_set), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set */ - {__pyx_k_set_2, sizeof(__pyx_k_set_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_2 */ - {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */ - {__pyx_k_singlevalue, sizeof(__pyx_k_singlevalue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_singlevalue */ - {__pyx_k_str, sizeof(__pyx_k_str), 0, 1, 1}, /* PyObject cname: __pyx_n_u_str */ - {__pyx_k_sum, sizeof(__pyx_k_sum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sum */ - {__pyx_k_sum_value, sizeof(__pyx_k_sum_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sum_value */ - {__pyx_k_sum_vars, sizeof(__pyx_k_sum_vars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sum_vars */ - {__pyx_k_t_max, sizeof(__pyx_k_t_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_t_max */ - {__pyx_k_t_min, sizeof(__pyx_k_t_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_t_min */ - {__pyx_k_target_dom, sizeof(__pyx_k_target_dom), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_dom */ - {__pyx_k_target_domain, sizeof(__pyx_k_target_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_domain */ - {__pyx_k_target_max, sizeof(__pyx_k_target_max), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_max */ - {__pyx_k_target_min, sizeof(__pyx_k_target_min), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_min */ - {__pyx_k_target_value, sizeof(__pyx_k_target_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_value */ - {__pyx_k_target_var, sizeof(__pyx_k_target_var), 0, 1, 1}, /* PyObject cname: __pyx_n_u_target_var */ - {__pyx_k_temp_sum, sizeof(__pyx_k_temp_sum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_temp_sum */ - {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ - {__pyx_k_throw, sizeof(__pyx_k_throw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_throw */ - {__pyx_k_typing, sizeof(__pyx_k_typing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_typing */ - {__pyx_k_unassigned, sizeof(__pyx_k_unassigned), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unassigned */ - {__pyx_k_unassigned_2, sizeof(__pyx_k_unassigned_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unassigned_2 */ - {__pyx_k_unassigned_vars, sizeof(__pyx_k_unassigned_vars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unassigned_vars */ - {__pyx_k_unassignedvariable, sizeof(__pyx_k_unassignedvariable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unassignedvariable */ - {__pyx_k_v, sizeof(__pyx_k_v), 0, 1, 1}, /* PyObject cname: __pyx_n_u_v */ - {__pyx_k_val, sizeof(__pyx_k_val), 0, 1, 1}, /* PyObject cname: __pyx_n_u_val */ - {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ - {__pyx_k_values, sizeof(__pyx_k_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_values */ - {__pyx_k_var, sizeof(__pyx_k_var), 0, 1, 1}, /* PyObject cname: __pyx_n_u_var */ - {__pyx_k_variable, sizeof(__pyx_k_variable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable */ - {__pyx_k_variable_contains_lt1, sizeof(__pyx_k_variable_contains_lt1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_contains_lt1 */ - {__pyx_k_variable_contains_negative, sizeof(__pyx_k_variable_contains_negative), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_contains_negative */ - {__pyx_k_variable_with_lt1, sizeof(__pyx_k_variable_with_lt1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_with_lt1 */ - {__pyx_k_variable_with_negative, sizeof(__pyx_k_variable_with_negative), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_with_negative */ - {__pyx_k_variables, sizeof(__pyx_k_variables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables */ - {__pyx_k_vconstraints, sizeof(__pyx_k_vconstraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vconstraints */ - {__pyx_k_x, sizeof(__pyx_k_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x */ - {__pyx_k_zip, sizeof(__pyx_k_zip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zip */ - {0, 0, 0, 0, 0} -}; -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); - /* #### Code section: cached_builtins ### */ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 199, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 306, __pyx_L1_error) - __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(0, 330, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 392, __pyx_L1_error) - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(0, 405, __pyx_L1_error) - __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 410, __pyx_L1_error) - __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_min); if (!__pyx_builtin_min) __PYX_ERR(0, 415, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 1270, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_min); if (!__pyx_builtin_min) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_max); if (!__pyx_builtin_max) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 450, __pyx_L1_error) + + /* Cached unbound methods */ + __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get; + __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; + __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values; + __pyx_mstate->__pyx_umethod_PyList_Type__remove.type = (PyObject*)(&PyList_Type); + __pyx_mstate->__pyx_umethod_PyList_Type__remove.method_name = &__pyx_mstate->__pyx_n_u_remove; return 0; __pyx_L1_error:; return -1; @@ -45834,71 +48180,106 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "constraint/constraints.py":58 + /* "constraint/constraints.py":59 * variable = variables[0] * domain = domains[variable] * for value in domain[:]: # <<<<<<<<<<<<<< * if not self(variables, domains, {variable: value}): * domain.remove(value) */ - __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - /* "constraint/constraints.py":862 + /* "constraint/constraints.py":962 * all_bounds = [b for b in bounds] * if not all_bounds: * return 1, 1 # <<<<<<<<<<<<<< * * # Get all combinations of min/max to find global min/max product */ - __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 862, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); - /* "constraint/constraints.py":11 + /* "constraint/constraints.py":12 * """Abstract base class for constraints.""" * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< * """Perform the constraint checking. * */ - __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - /* "constraint/constraints.py":126 + /* "constraint/constraints.py":302 * """ * - * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< + * def __init__(self, exactsum: int | float, multipliers: Sequence | None = None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, ((PyObject*)Py_True)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/constraints.py":289 + /* "constraint/constraints.py":1456 * """ * - * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(2, ((PyObject*)__pyx_mstate_global->__pyx_int_1), ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); - - /* "constraint/constraints.py":1328 - * """ - * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< - * """Initialization method. - * -*/ - __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(2, ((PyObject*)__pyx_mstate_global->__pyx_int_1), ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 1328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]); + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_tuple; + for (Py_ssize_t i=0; i<4; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_slice; + for (Py_ssize_t i=0; i<1; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -45909,38 +48290,141 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get; - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; - __pyx_mstate->__pyx_umethod_PyList_Type__remove.type = (PyObject*)(&PyList_Type); - __pyx_mstate->__pyx_umethod_PyList_Type__remove.method_name = &__pyx_mstate->__pyx_n_u_remove; - if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_10 = PyLong_FromLong(10); if (unlikely(!__pyx_mstate->__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) + { + const struct { const unsigned int length: 10; } index[] = {{1},{36},{12},{55},{413},{420},{849},{854},{889},{909},{1003},{915},{357},{349},{349},{659},{676},{672},{707},{751},{725},{342},{945},{56},{28},{55},{179},{15},{13},{107},{1},{8},{25},{7},{6},{2},{11},{9},{11},{22},{31},{18},{27},{8},{28},{37},{37},{10},{19},{23},{21},{19},{28},{45},{28},{30},{47},{18},{27},{27},{29},{18},{27},{27},{15},{24},{24},{26},{17},{26},{43},{26},{28},{45},{16},{25},{25},{27},{17},{26},{26},{28},{16},{25},{25},{27},{18},{27},{27},{29},{20},{8},{19},{28},{28},{22},{31},{31},{10},{27},{53},{36},{36},{47},{41},{38},{26},{35},{52},{35},{54},{37},{25},{51},{34},{34},{45},{39},{36},{24},{33},{50},{33},{52},{35},{25},{51},{34},{34},{45},{39},{36},{24},{33},{50},{33},{52},{35},{10},{12},{6},{8},{9},{13},{16},{11},{18},{1},{4},{6},{1},{8},{10},{17},{18},{5},{15},{22},{17},{11},{12},{4},{7},{3},{6},{13},{11},{7},{5},{6},{9},{10},{8},{9},{11},{12},{12},{5},{4},{5},{8},{7},{3},{19},{2},{9},{5},{8},{13},{5},{9},{2},{1},{8},{3},{10},{15},{7},{8},{6},{7},{6},{13},{3},{10},{15},{7},{8},{6},{7},{6},{7},{11},{16},{10},{15},{10},{11},{12},{1},{2},{8},{4},{1},{9},{9},{14},{16},{14},{14},{10},{10},{1},{5},{3},{12},{12},{14},{10},{11},{4},{5},{7},{12},{8},{12},{6},{5},{13},{4},{4},{4},{3},{4},{12},{10},{11},{3},{3},{14},{31},{9},{8},{5},{5},{10},{13},{10},{10},{12},{10},{8},{8},{5},{11},{10},{15},{18},{1},{3},{5},{6},{3},{16},{8},{8},{8},{22},{17},{9},{12},{1},{3},{17},{246},{395},{297},{95},{287},{355},{184},{535},{249},{249},{195},{445},{20},{25},{23},{109},{216},{216},{138},{92},{220},{464},{262},{296},{114},{167},{91},{91},{19},{14},{151},{2},{2},{142},{11},{160},{24},{146},{30},{14},{22},{33},{41},{22},{2},{2},{2},{2},{23},{25},{2},{86},{48},{148},{161}}; + #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (4920 bytes) */ +const char* const cstring = "(\265/\375`\206au\231\000\212\221\030\037;\360X7\314\300\304\210\233\032\344\235x@\300\n)$e\220O\230\233\312\2520Rv\263~\255\0375>'O\264\256\213\325UF\035\245i`-(\223\032\\\252k#Im%\312\327\001\324\001\323\001\351\001G{ey\310*r\237\353\036\nw\357\266\271\252ij\246v\331u\345:\210\356\275\222CV\212\374\335\2207\276\203R\256\232\016}>\356\236\333i\267%)%6\237\031\037rm\267{\246\333\325\251\272\321\225mr\245v\373V\206\220\350\332t\272\032\350\003\016W\276\323j\227\247\244\233\222\\\267;U\203\251\253\016\201:8)\322\205&E\212\020?\022\254p%\271B\245\311\027\322G\256\355\320\335\355\355v\373\360\221\"\332\203\237)\023\253\236k\372\333(\371#\203\272\215\"\233\316\264)\212\250Y`\211\303ir\273z\267'Q\007\2078[\216\204$7d\201Zk\342\236\301\311\250\252n\335\355\376\375R\224\334\255VU]\226\245-\207\313\345rD\235c\2019\033.WRRR\302\222\220\220\330HN\237\010I.\207\003\016{9\340\220\347J\242f\201eiR\256\351\216\215\2476\233\315f+m\244\010\316\226t\326\316\232{\236-\273j\256\352\241p\273\347\020\305\271,\017\273&\341p\276\232\007)\362Q\222\"5]\3638:\032\252l\317\335L\304\217\017\017\016\334nz#z\240\333mY\376\221T\036\271\273\267\336\364<\222p\244HyD\212$e\3702H\221\014\235q\344!\204\242\372\366\341\341C\272\220@\366\345\345ee\253A\240&\316\220\t\t7wsM\256\351\346\273\r\362!0m\327\r\2252\361=T5\024\271\177,\271\201,']\256\267J\272\272\311%\231\326\364\\\267\224\352\236\273MQ\022\335\252\272\331\225\\\365I\262\251{\256C\232\255\372\264\232\006\201\354n\335\301\240n\"\335\332\252w7\356\256\351\312\236d\313\376H\316\265z\222\233k\037\351\236\272u\271Ow\013>\306\227^\343e\360\276\\s\351\333\216\321\360u\006\034\000\353\022:/\363//\315\303|\255O\274\216M4E\327SeY\237\217\3575u\207l\313\23676=W)\256\271\273n\240\211\256{\3774\347\350:d}\246\211\356\225)\345\\\257A\277\375\343\0227\217)C\224\3621\3156H\334\353\013g\325\226\033\347\373|:w\323\016mu\224\2733MU\325\247i\336\222\266\032\034\272G.OU\224\263\352\357dZ7OQ\251\340md\2330\267\225\325*yr\365\351L\203m;\224\024\274w\366\302Zp/\326\222\365\023(\007X\207\214\037 \352\270\356\332\314\374\331\013^G#\212.\321z_/\332\373\371\334\330\003\363\177\344\331\315\207\304oy-\257#<\302\342V\354\344;\310\231&\007\310G0\016\347\335\216\001\013\371\233^!\364\006^\252\224\025v\360\332qZ\003\360\201\227\351V\306\230\361F\345\267q\211\224\377\361\034\016\037\007+\373~\0378:\014\016\211\020\241\370*\265\331\261\324\236\245\357r\340\022\026H\320X\014\007\263\256\313Z\276\327W*\342\230\370'\214\305S\276Vq\344\305\272\030\004\006\331\2305\034\003\253x\rr\326\3467\213~QiT(\220{\361\n\034B\316B\370\001F\360d\005\204\247E\224\010!b}\352\010\203\237\010z\304\323\220\354\310;\352~1;\352\342\2148\250s\035\263\300n\316+\275\004:\024'\357x\303\252\353\236\213\275\273w\330\362\302\236\363\316\364\273\361\312^\210\227\201\016F\204\373B\200\370\214\212\231\326\341\003\274I\247\210x\360\010=b6\363\274\316\01751}&\364\243C\277\367{>_\2478$\337\304C\270\305\327t\225\240\237\037d\234\031\333\342\256h\225\213]\231\237\351\003\375\340\225\021\366\207\336\352&\272\376{g\235B\217x\tt)X\010\014\203O\337\361\360qf\236\034\022\243\300!\263\257\353\256\230\026sx\007\213""\310\276\213u\324\357\303\301L{c2\357\254\241S\314dN\375\"b\346i\331A\006\212qq,\006\202q\260R\327\365\212\331I\257yg\257\226\207\350\022\257\243>2\375\376o\351/!}$\242O\004\364\201|\276\317\030c\034\222\311-\371\306\363\034\263\231f\014*\316\2123r)\327\304e,\020\233\3004\030\205\367\237n1\233_3\255\310\345\037YC\246\2029`4\016\307\223\366\362xs\257=CY\244\221\211\007 |\017\261^\323Bx\244\224\201\260\205\247\345\274\000\013\315\210C\3734\231\307?\264\235\267z\265\321\2428\022\303x\ro\004\353;7A\335\202\327y2\317\273rbY0y\007\243\345\311\027\207f\226U\341k$L\367\242\367\005\245\273:)u\372@\274\333\200UX\225\206q\364k\343\312\322]\035\217\214\276\021\357?\025ebY\334\332\354x\304\001\250\302\213{S^\307\243W\366\266\357\314K\226\303lF8\230\037\034\346\030l\236\311\216\272+\035\254\363s\253\364\356\306\237\200e\034a\360\307\005\002\300F\226\251\364\225t\276\216\312W\351\370\035\003\277\354\264\256\036[2\303'J\371)45\230gt\024^\254\021'\275\036\342'\037c\361\303\373H\305\033\271\224Yj\277\304W\275\020\260^\004\254\010$\257\\t\211\"\242\257\343+\306\024Ad\230\214\000B\272~\200Q@QQ\000\017O\300\316N\000N\000N\253\n\000 \213J\370\205\300\017|\372O\276\357\2132jc\316\250\324\3002\245\324-\312Xa}q\260\\\376y\323\027\3728G2\316\000\006\351\001:\001\243I\221V\214\031\371%p\310\304\327\365\272\205\217\230u\362\200,\214\r\250\240\274P\2779\352<<\332c\204]\303\255\257A|\231\330\005\373\374\006\255\006\324\373U\305T\346\311.\037\037\310/\350\336\362\025\200y \033X|\3028~ \327)\034\212\271\342\256\374@0A\303wp\230\0359^VBX\303Q\276\366\372\027\256\277\300+.\310R\277\020X|\002\307\340\232\227\350-\355\013\274\257GM\344 \350\372\320\353\320r\315T.\004\200\216\254\337\376\033\347\343\240|\224\215\277\341\372.\036\254\005\004\000\206,\035\237h|\215[\226\220)\346i\260\337\n_\2167\266\003\205%\250\023\311Z\"\224J\r\215\210$I\222\326\023a\0204&\226\213\207\265a\027?\223\323\342$\024\206\2014\2040\010B1\010\2070\005\004\021B\210\300\020\242\210\010\211\314\314\330\001K\212n\032u@{6\274t.D""\320R\226\255\267\370N%\355\211oS\001\355:!O\321\331\217\266t\300\321\240\345\313Ui*\016|p\233\313\202\315\002*\210\304U\006\302\001\242\312\\\225&\213Z\266VR\267\326\267\351h\326s0s\266\261\220\200\353\365S\254*!\036\335\205%\035\221{a\316f\231Az\034\310ip\231\320\033\232g\351\341T(g\254I\031\022a\355q4\017J\331U\3306\215D\355\215\020\260\331}\272\212\035;\275}\315\017\035\262\210\251\301\230H<\344\265\257\003\230\300\251G.v\305!(-aSCFDeX\014q\215d\261\221\006v\323\035\317\023\350\233\026\243\204V\325';\214i\240\320M\372\250t\240\247Ula5\314Ir\304\021\314\362\236\341\336\352H\354\023\225\230\n\277~\210\310\226}\221\316\313\236\236\030%\210\271%\264\022(\"\316[r\rU\036F\247\206\203Q\311\312\375PS\374t\266;wP5\006\204\253\\\375\304\002\334\346\3617\220\t\372\250$\325EZa<`\3360\315X@\225\216\013\265x\307\017yz3\177\351\314\010SI\373\332\366}d1\032L\257SR\024\0259\241\237'T\235\211\301p'\000\314\020\225F\235\265\007\033\244\340\201z\233\341\333\004\265\375\020\255\324\013\350\3442ix\0360\336mw{`\026ttz{\266\256\036\006\334h\013\321Z\364\350G\323p9\311\276\252a\212\023)L\333\032`L>\004\363\000\253[\262\272\007\207\324\001\315G\331\021r\010\010 o/\317\302b~\275\303I\344\307Iy\231\342t\203\332\216\261uh\002U\025y%\314\215\\8\341\363\357a\021$\351_\312d5\017\371\021\335\270\031F\035\022;\351\263\305\005JRp\033b9!\203\352T\216\235\315\361\317\237P\026\036\346\352\241\266\314+\273\302L\340\307\030\025Kdo\350WZ]\375\220\315\245\260\215\222\n\226\365i\232T\331B>\242\204\374\235;\242\200\320G\226.\310d\322[\375\3560\262\010\0273c\0379\254)\230!\225_K\"\276\005\tU\031\022\214n\207a8\226\003X\r\273Wc\353\370\232^x1\004OMP\245JC_o\r\266xv\031,p\3259\277x`@\377\031\303\335a\351\310\2369\001\2741\001D\275./W\206\002\214\206c7\247\303\303\232(\304\223\333'\201b\275z\013cG\360d\275#\037Y\n\334(\000\314iK\244\207\236\342\177\332\347\307\267C\332\017\255\363\266\235(\210i\325\375\366\357 \341)\r\240\0301r\n7:\371+x4K\342\227ht\372&\351\036j\203_XL\341\273\331\030\260\034\3207\203\r\302\220\240\312#u\235\376\277\243\034\315>\326]\341>/%\335\344\030C\3719G8\371\301\231\316\033\357\356\021dI\366\313\025#\270&\213\002\351UAg\375\221Wef\246\221\374\276;C\2563R\227\371\035,\006\316y#4\213\034\324H\221\335\025\312dp30\304M\201*=\317\201F\243_\314\243o\270\031\210\335\230q\330?\215+]\312\312\325\256\007SN\331M\257GTc\3767\321J\245O>a\304\201\201\026R\303#\\\227\021^\320\252\211\230\275lm\246O\254\311\n\344D\341\376\022-g&\307\223.D<\232\010k\206\357<\227\242\014\317\242P\354\376\t\005}d\017\2122A\307\035\256~\014\371\305yk\211\027^\210`7\237\0043\231\365Y\352\004\372\307Z\t6\352\230\003\244\253=\245\023\035\341A\253\251\026\2569t\314W\231\363\020s7\224\026\321m\3573\257V\360\365R\030\036\351#\343\003\257\233\364\251\367F\203\214\376\253N@_\257\260Q\330s\362\367\241jM4;\300\321\215""\205\177r\206\3669\360\230.\322\342\205(\360P\256u~\233\225\3003\251\301\313Z\005Ae\t\222A\000l\202\"\330\377j\315*\350\024\316S\033\254\023W\000g\250\377\337$\326\313c\206+T\332,\356\262:G\354\034\202\365yY\031\235\372\210\222M\201\244/\026\222g\344/\310\022ov+D\267\231<\032\263\364\356lY\275t.\206.\2731\333Yx4\271=nA\344B\023Gr\310\276aO\337\265&\336\\I\236r\333^o\352\030o\037mdP\362\033)\322$\332\233fJ?\240:\n\317\305\242l\335\016\210\346*\2134\346\363\256e\275\032\013\2659\010\310I`\351\337\025D\335\223\022;\366\205\332|\353\004\271\\\315Z\353E\365\31188\325\311\031e\250\271\272\026i\202\311\020\246fOd(\r\372@;\270\204\202\313\247\254\245\316\212\324\263:Z\252b\010\007\004\327,n\214\265\3509\270\202\345\322\036\307\334\267%\247]f:3HF\234G/\304_\235h\250\r\354|\316w\005.\"W\211\333\340\202z\010r\"\315\014\351\216Ao\263)\347S\275\246$C\035\202\235\273\373\256P\354F\3043\016t\261\003\004{\202Z\362@\3749yd\320D\303MN\265,\224\251\205f\\\201\325\220\316\301fe\257\031d\331\215\343\226\022WgL\345O\301\306\0149\"\005oh\256\332\013\245e\232\t\315\370 /\331\276~\240\256\204\217d\030\332_G\335W\032>%\373\232\353:\233\337h@\\\020\317G\004@\017\003\003\345\200\323\340\342uL6\3615\004\257\221-[\327\030f\r\022\002\231]\343\022M|\\\310V\220\002DS\\\226\030\324\373\017|[O\227X9\207\021\017\314\322C7\222\026a\330a\323\0016\227i\267\036B\210L\327o\"L\275\230\312\2072\n\367^\234\322\276\305\003LJ\321\312Jw\2023q\021\020GY\226\315\252\\\201\351\237\177\316\260\332\265Y\253q\270\316^\211+L\204E\017\225\026\335r\\\204\363\\\221#\230\365h\374\374\212\350G_\255%\366\254]\206\242h\030\252\016\033\373\216\233j\244g\324\303Z\361L\212~\253z\360\262\035\367\270\300\007f\027\246\301i\361\243\013\276z\336fF\323\272\021\001\021\352H\332\303\306\376\020\210\021\361t\314\tJ\275I\311\237\272O\365\355w\333;\022\257\227RDY\232}\0353\212\244)\351TQF\244\270XPy\216<\250[\220v\027\272zxq\220F!\305\220#A\"\024I\n\005\254\243E\262@\244\n\301b \214\nH2X\261 \3061\255\224(R\005\264\224\247)\t\260\343\t\354\200\016\351& \003\001`\252\366\372N\220\263\364\364\300\355\r\375\241n\005T\361\342\252\222\"\2360h>\332\001\251S\326*\301\274\215\344P*\000@\347#\351U\244U\352\323\277\364\320\016x\260\000N\301$Y$\243$\224;i\331_\302U\203\350\353\203\030\303q\202I.TTEQ\021fSC\0060\036#0\255\306\014\024ePb\n\305\220`\230ZX\211\206\250\345\014\252ac\024S8\243\342\034\303\252|_w\260\340\026&\312\355\256\033TF\270\302\326mJ)\206\005&\005v\270\"\246YQ\271\206\0253<\017'\204\007~o@\340\235\001\277\346B7\003\312\215\245`r\207\202\002rrI\016Pz\205@\210\005G\232\200\205\"\332\002$\336\345sm\271\002F\001\224\3031\006\322L\343\035>\353\203P\230\204\001\022\"\214P\n\227O~x\264\332}\260\347\237\010\352\364 \007\275`\21262\022\220` \377^\246""\356\277X\234\237-\223s\266\031\t\t\010z\177r\231L)\021\032z\320B\237\024?\024Z\240\035J\265\004\273p\356\364\266\324\361\360\350\003\207\302\177\005\276\261t`B\014\213\010\262\"\302#\025\030\214R(\252\261H\306EEID\244\322\025\220\261\013M\245%\326\305\310m\016\037\201\030nDq\204n\367\016 ]\240\302f\025\215\377\306\201$\220Q61\305\224 F\010\213\215\n\271\241\320\2114!7($\321\022\303!#\\r\3476r\312\252DF\000\252\304Qc\026\"1$\221\n\024\022\233\"\r\2601\014\323#$.\014\234\214c!$\222\004&id2\034\223##\3406\007\331\314\\\341\230\231\250f\246a\2213w#\205\351ym\037Z6V\315\237\244}hLQ\271\270\211\210\216\3061\007X\325\334\nf\010\220\220\002\366\244\342\003u\000:\200(L\230U\327\350\263\270K\234<\302\352p@<\272\033}\026<\242\240n\026\n\201\274T\r\r+\367\341\2277&1\342W\034-\026\342\222@\322\022L\2479&ivc\"\273\270\224\002\021R\331\303\006:\251\235(\322(c\207rTT^}w\264\313=\277\001\352\333o\005~\207\350 R^\372\310I\037w\032\225`F\000\0244).qq\234c\030[-U\014[\214c\013\211j\252M\211c\377-\315\252\253k\256\272\351\2464\306\026\313U{\275\373\200\335\007\234N\177\232o\335\265\3542L\200\310\311L\203\203\221\320\373\371\275\007Q\317M\363\344\217e\251H\334]B\320\222\351\322\241\312nC^{\246E2\231L\361\304\304\240\363\025\r\3259\216c\354\243\256z\352\024\232\312JI)14t\034\2646}\243\220?|R\036\022*\252\202\237JJ|\025\367e*R\005\305>x5\n|\361\000\262\257/\222\252\275;z\335\341\321\017_\276$\235$\357\322\007baU\005U\021UUz\324\242\252\252\2569\2277\300!<\235s\332\3273HCf\315:\3736mqj\244\322\013[\r#\214\244\257\004\226\223\334\364M\3424\352\200\250\302Sy$Zw-:/zL\275\273u0\314\305\231\205\311\205\356\346\366S\323\r\346\225K`j\016vQ`\276\016\035)I\301\003\177h\316\243 R\344|\334\376\346M\241c'\024\223t\020\006h\000/\240\346\351\374\n\310\201\002\"\033\372%\021\036o\326\345\247:\241\212\010xw\003\"XB\304\025!\001\351\206\366\211\300Q\257Z3\243\021v\244>\014\020\334\342;T;0\312\3058\364Tn\256\246A\340n\017\ry@\324\n,P`\244\000!X\005\271\370Z\007'\205\232@\313\303\333\023\243\221\321\010\201\302\315\373\264\322\275\275\247\303\375*\271+\361>\1778|\036\201~`P>\220K\243',\230\271$\251\210C(\3030\352\213\013b\202\256\216\213\373\227\205\346S\t.\261,t\036\201\003\304\000\2648N\237\331\363\036\260\260\372w\334\202\024bq\005\022\"=\276 \357\303\375\261\345w\206\364\340\3619\377\360:\007\241U\326\034y-\223\211G\014\205\204q\315\266\210\234\033\234,\302\031\253\251r\005\227\353\246\204\374\317N\027\236\216J\324\371=\315\236\213\363-{\263\3041V;H\024\205\nb\016e\t\013R4:\303\254|w\336H\252\3578\003\320\200DB\001X\000J4\241i%s\273!\020\246z\020\313q\016\332t\306nP\361P\351\272\221\322\305u\ri\320\311,2R\030\322\020\005\030\305\204\201\325\004(\"AA\232\213#\r \033\263\0000`\221QE\340\273\t\0078\241E\256\210\030M\0163\245K\245\256\304\316\265\243Y8\n\264\316\220\000\245\251N5\256h%\342\036{\265\357\230\020\202cEZTk\235hG\035 \032l\263\2678\200\r\360\255\031\031\224i\337\315\313\016\240\016q:\200\352S\252\305\203`s|\253C\302\241\310\005X\201\341\257\023\270\207F\010z\304H&\370\027\356\222\2365>!5W{\332\032\rM\250\007/>\363\264\352\344\314C\217$\231}\n;\245\313\0139RP\205\263\002\234$\034W\261o\303D'\225\277v\024h\352\226\272\301@\003\332\000;\312\275\272\321\365\252\320\010\241(\220XHHI\272\314\214!\305\342Nz\247\"\232c\215tM\0255&2\035W\320%`i\205s\206\300j^\227\236\277\214\250\025\305\317\023\361\016\317\367@\375\350\014\210E>\363\010\300EAH\010\250\305\362\203\371\310\277\310?rE\207\227\004Q\017\001\005\222\201\000\250?P\202\237\332v\236j=\207\335\367=E\010A\375\021\200z\366\034\204d>\355\n \212{d@+\t;c\356n\263~\255\006\365\254\306\004\006\004\3437\210c\312.\374\317$\343\035*\000\031\275\016\025\221\246\337\253\230\312\024Nd\262#\"\0253?gg\323\344\377\243PA;\211R\241F\205(\300\235o$\374s\323\235\271\360Pm$\365\004\017[\310\017g\312S\032\235\235\245\324`mS\314\373\301\303\345\237e}\274\246\202J\303\023\332!\345\242\021\212u5);\301Hq\232\243\021D\001\377%\272oP\010\211A\004\2048U{\301V\257\234D \272\205:}\303Z\245A\033E\220\255\333i\016\215j\3438j\032\215aI\033\025\3031U\251\320\323\261\272\265\rJ\006\002m:\273\225\265J\340\346\253H\"\361X+&c\300f\300\251SK\242\343i^62)\037v\376l\000\312\013\246I\227\227\021\275\375\314\243'2\376&a\0207r\313\374\216\246\261\320M\316\266\266\357`\255\263\237H\266\273\006\2474\366\017\005\241\203\230\230L\370\366\216I\213\205\277yc\031\201\216g!r\014\237\242\354\253\247\240wC\246\261\261\307acb\207<\027i\261\377\353A\347\263\300\352\353\257JUW\016A\367\323(\2675\037\027\023V\346r\363\217\326\343\300\010\346\317kgu\0379\316\252\032g0\244\031\001\313\301\243\364\257\204\300\r\276W\316\205\\\274\205\213\215\255v\273&2P\257!O\3125l\342\241m,\312k\217[\036\227\207H\345\035\260\332\014 \244.I\367\235]\237N\257\007\031\210\035\021\032(W\367\005\304\030\341\246\024\303\232\032\353\334]F\370\031uj\264\n%VT\026\346BxP\306\256+&\311\264\254j\372^\272L\3035Z\306\0258W\034ho\353n\353\020\2056h\342\2656\3161\"L\221\316\302\0065e\227\251\255c\302\340\230\340\326\223v\226\311)\213I(\220`\344\324(\033$\240\242B\336\261h\212\206\240\221s\024\017\232\247\2012\260[b\231Y\254L(\3474\214\274\332\315\007A\244V\030\030\303Y\242\215$Ah\264\305N&\020(j\330\2601\305Ai\010\2711\006\225V\257\025xd\3650\274\350\324\267""\006\310\327i\",-\312\275\270\361\266(\310\032\262\204Fr\243\276*\261/\244Js\031\021e\000\215X\255\320\235\205\n,\240dJ\2526MDlX:\263/\006Z\251\322\212\225hf\216\346\245\354\325o\2474t\304\000D*\322G\"b\241\021s\304V\224y\020H\004\303j\004\010\374\240\000^\001\367\r\014\004\221\226\300U\210\242\330\r\027\230\"\256n\343\257\377\342\356H\247\n\022\033=\204m\340"; + PyObject *data = __Pyx_DecompressString(cstring, 5052, 2); + if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) + const char* const bytes = __Pyx_PyBytes_AsString(data); + #if !CYTHON_ASSUME_SAFE_MACROS + if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } + #endif + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (5080 bytes) */ +const char* const cstring = "x\332\345\034K{\322\332\326\326zl\217\034--}\370\016\265\332V[\216@}\325{<\037\266z\264>\256X\337=\312\r\220\266\034!@\022l{\324\357;\303\0163\3140\303\0143d\310\220a\206\014\371\t\375\tw\255\235\020\002$@\037Z\274\327O\223\235\375X{\275\367Z+D_(\312\013\034\035\023\250(\3153T,I\363<\265\222\346\250X\232\305\201\004+\360\276y\232\235\020\2505:\223a\330\371t*\223H\322\321$s?\307\306\204D\032z*3\251\030\315Rl\032`\001$:\231d\342T<\30111!\271i\231\304\260\000?\226`W)a\215\026(\370\233dh^\240\370t\212\241\322+\320\313P\237\350d\216\341\361i5\361\211a\341\231K\340\236<\225\312\361\004~\206cx\006\240%X\2126&\361\214\340\373\371g\n\376\334\333\240S\231$3G\036\360\317\235;w`E\032 \244\250\337\250gzkr\312n\334G\307\343\257*\333M.\217\321c\323\324Xt\354\3754\265\354\237\246\002\357\035\027UI\234\\\002R\036\262K\214`\351[\366\277\237\252]\313\2479\201\211O\032\267\r_B`R\374\344\324\024\341\377\006RV\201\276\312\010K\351d\016\271\215\023L(\313\313\223\023\364\3044\345\237\232\246&'\242\244\205\210\326\367\006,\275\001\353\334\367\004\324\376\n\307P\200\216\027\320\323\264p02r\224\206Mo\240\265\214P$\200D<\007F\0142\251J\203\311\346\350$_\025\031\216\322 \2355\2063g};y\300%\2663\241T\200\00021\001\266\264\216M\304\200\031\313\2049\300\227\357cI\330\2125\261\251\312\270\223<-\343\357\367Y\321g\002\323\324Ls\306VV\032\254\303\025\376\037F\0143U>\317\330\013b\306N\0223\366\242\260\200\230\331\213A%\370\252C\310*u\373L\266c0\276\035\260\274\032@\007\330i/\007\276\363\213\201\035\025\373[k0\311\354:G{\357!:\337Wsw\375&\305Ys\361\330f0\235In\342\261]y\241E\247\322\271\216q\0256\351V\360\340\375\304>\236\233\300\211\253\355\276\304\260a\306\325\357\223m\332\347\230\016\231\345\036U\322\2324v\244N6$\006\301N}\277\372\335\222\255f\334\201p\346\273dJ\016\351\221}(\275G\035\315e:W;\353\003\345`\247\376B\343@\264\263\236;\337G;k\323\205v\264v\367\372\031\343\030Z`@9-/\246*\307|\275\306\342\036\235s\316\327\275\246\010\374O\035\364\225W={\341\310\267TV\373Ce\306\236U5\311\252\303{\263\375Ta\303\337V\"\203\216U\343\306\327\340\201\377\203\330\240\365[\314\246,\362\177\247\332\215\323/\002\234~\007`\337\357\337\377\210\302Y\335II\265s\265\275\341\315r\340\377 \326\330\231\2667\260h\306\177\200>\334\337\332\207\357W*\207e\233\016\257\211\035\330\257\231\033\270\272\276\226\210\255Q\353\034\235\001\306Q+\306\217\320\2518\263\222`u^3\226\037\257S\311\364j\"V\313D\376;p\021\320!\270M\322\323Tt\252\272\241\317\347#w\216\021r\034KE\251;\024\335\006\373\021\024ldnj\217\241\205\261\026\032>\003S\3470\230\002\226\316Q\201\257?\377p\3247~i@\0302\265o\034\331;C\010\023\234\3611\031\2621Mm:3d\203\362\376Fm\356\215#6\342\330\027\323Dv\321\023h\232\001\3028\335\017\352L\254\364\302\270a\260\2171\366L\345\222B\"\223L0\234\371\331\006\314\247y*!\340\257\376\320R\005\232\203=\253\257<\237\230K\252\237z\260\271T\024\236\033\307R\264\000\256\000\213\014\026_\312\306\251+~B\231\016\333\3674\r\001\003\361\300\363\233\302\032\270\n\330:\316$\023\000\023B\t\310\364\200\203\211\230\000H\302$\226zv\357\331\314\354\315Y\002\210c\376bb\002\3261\242\344\313\030\335}Gs\t@""\004\374\364f\206\341}\324\303\025j3\235\243X\206\211c(\222\301/h,\013\200J\342\310\t\271\0234\313\246\005\032\371\033\201\345\340\257&\214Od\300\337\343\352\373t\222g|KL6\307\2601\206\372B=M\263L\345q\0310}\377\232\303\357p\270\252\347CR3\211\330G\362Q\016!\006\274\240\345\363\035\235\366\n3c\344\373\035@\025\206\260,c\363\025O\222Ff\244Y\337\357\240t\021\300\227\251B\373\325\372]Pf3\236\340qW\206\305\353j\014W\177\241V\222i\240\220\327;\343\311\004/,\0139\360\273\357\355_f\331\367\372\"\021\374\204(\022i|\207\320\330cN\236\207+\356\332\354+\245fcU@\315'\301Q#\340\244*L\033\010f\027Hh\235\346\342\363kL\354\243\245\033\216|p11\206\347m\022X\233.\023t\2631\337\277\222ih\361w\300\226Yf#\303\331O\326\t\260\033k\212\225e\324~\243\232\212QcO-\t\365C\026\244j\207\252\2736J\243\211\020\233\210\256.\236\251{4!4\366\333.\267 \330\020\3056t\230\300\235G\032xk7U\307\244q\244\t.\315\304W_\356\253\177\266\242m/\270\206\001\013&\365\231lCG\025\274\315\210\001\277a\244f\203Z\354\353\236\255\340\035\260\257\037\250\002o|!\334\330cn`;\244oa3T\335$\022y\266\271\001\377\026\340,\212U\277\032""\0141\036p\236\336\344\311K\304\010\271\222\013R\0361[\244\001ik\244\322`6b\311\\\234\211@\032k\315\025\214vLo\303N\230\363E\310\305\270\032\342C\335n\324\357\265\304Z\"\316\274\302\262# \314lT\024$\222\340#&\303I-\000.\234\000|\347\223i\340)!\006\256\033\3607B~\222\314c\013\021N%@v\354*<\022\212\214;\334\310 \271\301\365\023\rBK1\002\255\013\013V\261\360\267\002\nZVP\tV\007\245\337\341\246\017\342\r\256\000\312\234Hn(\220J\223eViL\234a\007\240;\twhq\351\010h\026\227@e\251\026 \252-\336\322\313\263\021\240\224\245S\260\024\030\t,@\024\221\020\243\221\320\177\222]a,\257?\345\314xG\177\006\261\361\325E\372\223\261\262\332O\3722\031\232K\361\231t&\223\006\010`p\204\205f\033&T\332\270#o\215\016\241\r\213\231\010\0311F\tR\025\241\343\276\025<#\021L\220u\3028&\225\376\304p\250\0225~\215\207\264\235g\222+\220\250\307yP\036\374G.\3722h\305\231\025\032x\205\274N2z\371Z\340@.(\241*\255\265O\r\256\005\207\365\265\244\301\361\002\322, \261z\201\006\215\252\332\242\315n\234e\264\314>\002\310ls\240\273\031\242L\021\360\r\200\275\260\306\245\327-\342\261k\021\034\252\217\225\312\321'\000M\240\353\270B7NDS1\265\014\237\321\020\310\035US_\0311\033V\247av\256'\2045k\007\377\311\342f6\376Nd\264C\347\264ssyo\271\347\330VpkU\014k=c\332\3305\355\332\203\342OE\272\324{lkv\353\213tC\366\226\\\203\242\277\334;\"~\226\275\362\254\234-\365\236\226\374\245\336S\222\267\334\353\332\372C\234\025\263%\327\211-A\014\212t\251\177\\~\244d\325\256r\377yi]\246\345l\031\000\315\001\360\341I\245\253\344:/\345\344\220v\361\206J\372g\267`\345\24068.\317\313\331\355\237\016\365\235\224\272\245\013RXZ\225\3032\243\004\025ZYWi5\227_(\034)\204K\275CbX\214K>\245K\031T\026\324#\352\353\374\335|\264\320SX(\366\024\027\264g\257\264W\257K\200'\257\235\232VB\325\026n\365\033@\236\221yeF\345\362nB\321\366\330\241\276\376\255l\373T\217J]\004\005;\252\275\362i%\244\204\313\375\247\244\t\331-{\253\324\211w\344A9\264_\304\235\224\3340\245[\031#S\302\210op\213\326N\234\2278\331m\240|l\313_r\365\213G\001\301\376\013\262_""\276+\307\225\213\312\347\374\205\374\363<_\360\226\372aV\311sVz.\361@\332\r\305\253\\S\017\253~\365\217\274?\177\257\340)\274,zK\236\213\200d\\\361\345\273\362\203\004\301\327\305\273\305\250\366\354\205\366\342\215\366\346O\355\317\377h\377Y\321VV\313d\"]\356?)\215\310]\200B\277G\374C\272\016\r\317\031)$}P\002\312\013u@\r\250/\362Cy\032w\r\227F\317I\177\001\225nD\004\271\350\001u*\367\236h\020\205G\\@\216\303@\251w@\364\226z\207E\272\254\023\274%h\203\323\312\274\302\253^\225\020\353\222B\260\265\346\271\242\334P\257\344\201/\256\255Em\370\222\034S\334\312\025\330\334\215\262\332\224\016\203\342\366\217J\307\200+!\224U\205\031\206\256\226t]\025W\000\032\360\362\232\324%\rKY\004\266 \366J=\322=\020\345#EP\203 \267\257\205\371\002W\364\024_j\317\201)/\t\357K\025\336\023t\006\305[\322\037\362\277\224\234\3720\377\272\360X{\266\244-\241\024\265\327q-\276\252\255\256!;^\313!9\\\362\214J}\3620 0zZ\272&w\313\227@\304\336\322\2311\3712jU\3113\"\n\200\371\350yD\246\236Q\250\216\217\201Q\204\300\2430\243\177D$\3064(\216\203j\352\3743\246x\304GRV\356r\242\363\304VN\234\027\353\3450`\201\323\tr8,\005%Z\372J\266\035W\231|\000\36690\356#7\342\222a\357\016\216\303#\206\010\347L\323<\"~\220\203@\250\240\334Vi\335\014x\340\201G\367\"/\32515T\366\234\223\35021c\334\274~N\270\014\r\360+\362k\035E\234l0\355#:\202Q\351\010x\232\217\212\233\354Y\006\246\377-\r \234\021\335meuC\235\005\222\010y\210\367\250W\036!v9\212\376\375\014%\367)\303J\266D]Q\346\324\245\374O\340\214\216\025\375\350\212\336jo#Z\004<\000]\242.\310\267\224\273\n]\032\277\254\\VCj\270|fB\376\033,\036M$k\001\242\317[Q\357\252\325\271\270\021bp\006\274\224\3165\270\314IKr\327nX\2743\356V\271\247w\264\311i'&#\177\007\245\220\035\336\245^\335\315\365\036\337\242\311\251i\\\210)\221\223\324\300\373g\360\354\207\025\277\362\010\030G\324w^\"\316\3616\320\202,\365\227=\023@\324-\302:k\023\204O\244\250\235\236&\3320zE\361\227\210\310\335\322Et\010\303\"#\371\301{\271\365\023+\240\r]\224\237\313\233\340\365gUN\273\365\2608P""\254\252\306WiA\356Uz\340\200\351B%Y\224X\260\264\254z,\357\307M6\345\243h(\246\252\234\221\036\312\257`\2733\347%A\016@3\240,\347\273\363\336\022uI\376K\355R\335V!\227\255\306i\241.{ \224=\006G\330\036Ea[j\014\301\241t9\355\344\024\034\333\017\301\303y\362\317\265\337\377]\344\265\347Ke\227\241Kujq|+.V\024\240_\354*Y\0358\361\214'\245\323\240p\357\320\255\226\373\253*\202\024\022\005\275&\375$\305d\017\250\344\003bP\344\004%\212+H\001\351\rp@?U+D\367\310\013\340\322.\341)\017\007\203{\250\r\322?\241\276;\010\321\304\343:\350\374\002\2022\366\277\016>fV2\366\266q\225m\023\016\201\321\301\021\276\004\201\352>\023n8\002\267\350\021\303\206# L \216`W\346o\234\016\255\255\311r20\310\230\001\361\242\230E\307\245\307\272\234\346\366\312\003\206\377E\3241\240]u\362\301\265$\354\207\033\333\245\205g;\307]\3557\005{wK\365\372\267\35532\235\013\332\205\353*\275}\374P\337/[OQx.\315u\006O-}\000\355\261\246{\\\033\277\241\335X\324\026\031\215Y\331\276t\250\317E\202\276\317\230\306\224\\\210#\206\374\256!\3615\304\372a\024~\037\t\324\014\213\364K\217@\342\247P\022FZ\204\213\326\245\250\374\223L\343\361\331%\235\224'\224\001\345\272\352\256\333\014\365\352\n\034\256+\020oo\346\177)\2041\240\375Es\021,\0017\323u\234\303t\nv\326\372'\344uH\251\262\366!\347W\"\277~\3105/\242c+{\2060S%i\331\220\236fT\\\221v\002Y~Dy\241\371\347\013\301\002\004\020\016\024^'\001\225I\331\320i\010K\243\340q\026\225\030\010\244\322\177pt\031\341\377\276\321\365\200\304y\355\322\205\371,\302~\001\n\002\276\376\260\350\307\010\315L\234G\245_\344\027\332\324o\371p>Q\370\242-\275@\3074\001\026\343\325SW\014\300 \251v\313\343rTq\251\013\304F\0019H\266\265\221\t\231\003\213\360\240*\321R\266\035\016\327\362\302\236\352A\351\256\024\227'!\265\016\265Me\271\032\232\332\205\236\226\244\370\241\364J&\036\351\023\344\335\237a\023tRG\325l\276'\037\302\214x\225\244\321\325(\324\\z\026|q\217\034\2624\332\004\326j\274\265\004\2016\355\324\025eV\373\365n\301[\270V<\014\341\177\310\014g\221\231\335\322e,\335(G\211\307""\r\344\227\213=\305E\355\225\221aik\274\306\013\355\317$\266\260\265(\262d\3461\314(MQ\235\225>\2203\345\357\202\247\320\370X\247\276\267AiN\220B\217\251\306\216#\372\246\215\010~(\006\213tq\235d\214Q-\n\210~\324>\246\264TV\313~\336>t\350K\327b7\334\026\273\237\340\355I\367S\274=\355~\213\267\267\335\357\272\355\251\336;P\315EA\206z\031\016\213\276\274;\177\271p\267\020\005N>\326\336\274\335\265<\367C<'\245s\244o.\377\242\340\266\225\3071R\004\372\346|\3375\027\214\300\346\033\350jK\345\374v*\270{m)[\223\356l\251\231cj\323\037\265\336q\024\313W\004&\034\036K\020\035\270-\r\363\350\030\021\277\310\263\332\304\355\274?\377\260\360\247\026~n\347\320\317\022\310w\345\217\3520au?\226x0\213\177\257^P\303zY\340\2064\006\001\n\257L`P\352\354\362\215\244\245\351\3311\2021\233\031\343\324\0046\350/q\247\373\273\004=(\205\332\002}S\273\371\006\344\n@\265\343^\235\220\233\371\2562\354\221\224\274\222_\353\271\244]\272\245\335z\254=\376\240}\210l\217\037\352;'\205K\r\265C\210$H\210Q\362L)n\010'\312\0309\214\301\216nL\240NU\204O\252uf\331\014\242Nm|\016Nh\022\206\n\262\237\310\264\313RB3j}\326\222/\211S\345\220\022\372'T\036\364\224\334\003\245\241\341Ro_\3113\264}\007\243\262\220\221[\270\266\356\211$\326\341\304A\350\354\327\331\264\214Qq\271\277\3023L\026\321\214\\[7\305\000\330\261\013\213\307\307\340,\216C\366\327\255Nb\364\340\021\237\200\n<\000\345\344\324A\010)@\347\n\037\265\360;\355\335r\231$>$\362\371'\264\355Bs| 6\"\206FA\327\024S\221\326E\010\213\000\275/X\226,\365c:\340\306\320$\251\214++\352\274j\004\372\344\035D\217\364\030\255\273\256H\351\267\224\"Q\273o(^\275\332h-L^G\365\255r\024\231\367O\310\254\356\022\026\221:#\351o\300\273\276\010l\301\373\023\262\320\242k(\032\340UH|+\321v%U\177]\341\324m\203\035IR\374%jB\256\224L\317`\002\264\35518\213\270\334\327\205\273\010\021]\017%w\351\\\007\004k\237\210\023\203\350X\3539/}U\236\344\335\333\0038\362\210D $M1\350j9\301p\207\230\327\202\313uYs \200/\207\363a)\214/\301\316J/\221\n\\\365P?\021\236Hn\354~\007\311\214""\001\275: \303\320\005\371w\365\327\302YH\264\236W\274\312\234\372\\\345A/]^\315\273X$5\315\333\020h\037\006\245\005\373\323z\274\362Y%\225\367\353\033>!.\260\216\234Z\252~\305\034\301-Z]\245\371z\312\215\3415z[\332,\246\270\365\210{\200\024\323I\321C/\026\033o\255`\031\332\323\260\030\026\243\344\315\307\210\361\326\251\007,\247'\177\277@\352\232~\260\262\343\020\357\362\240\353\214JL\232\027\275@GL\367@\200Sy\3178\r\2318\270K\373\213\340\177\001O. 7"; + PyObject *data = __Pyx_DecompressString(cstring, 5080, 1); + if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) + const char* const bytes = __Pyx_PyBytes_AsString(data); + #if !CYTHON_ASSUME_SAFE_MACROS + if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } + #endif + #else /* compression: none (25222 bytes) */ +const char* const bytes = ".Abstract base class for constraints.Can't happenCompilableFunctionConstraint can not be called directlyConstraint enforcing that at least some of the values of given variables must be present in a given set.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(SomeInSetConstraint([1]))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1)], [('a', 1), ('b', 2)], [('a', 2), ('b', 1)]]\n Constraint enforcing that at least some of the values of given variables must not be present in a given set.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(SomeNotInSetConstraint([1]))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)], [('a', 2), ('b', 2)]]\n Constraint enforcing that the product of variables equals the value of another variable.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\", \"c\"], [1, 2])\n >>> problem.addConstraint(VariableExactProdConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1), ('c', 1)], [('a', 1), ('b', 2), ('c', 2)], [('a', 2), ('b', 1), ('c', 2)]]\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [-2, -1, 2])\n >>> problem.addVariable('c', [-2, 1])\n >>> problem.addConstraint(VariableExactProdConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -1), ('b', -1), ('c', 1)], [('a', -1), ('b', 2), ('c', -2)], [('a', 2), ('b', -1), ('c', -2)]]\n Constraint enforcing that the product of variables is at least the value of another variable.\n\n Example:\n >>> problem = Problem()\n >>> problem.ad""dVariables([\"a\", \"b\", \"c\"], [-1, 2])\n >>> problem.addConstraint(VariableMinProdConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -1), ('b', -1), ('c', -1)], [('a', 2), ('b', 2), ('c', -1)], [('a', 2), ('b', 2), ('c', 2)]]\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [-2, -1, 1])\n >>> problem.addVariable('c', [2, 5])\n >>> problem.addConstraint(VariableMinProdConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -2), ('b', -2), ('c', 2)], [('a', -2), ('b', -1), ('c', 2)], [('a', -1), ('b', -2), ('c', 2)]]\n Constraint enforcing that the product of variables is at most the value of another variable.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\", \"c\"], [-1, 2])\n >>> problem.addConstraint(VariableMaxProdConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -1), ('b', -1), ('c', 2)], [('a', -1), ('b', 2), ('c', -1)], [('a', -1), ('b', 2), ('c', 2)], [('a', 2), ('b', -1), ('c', -1)], [('a', 2), ('b', -1), ('c', 2)]]\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [-2, -1, 1])\n >>> problem.addVariable('c', [-2, -3])\n >>> problem.addConstraint(VariableMaxProdConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -2), ('b', 1), ('c', -2)], [('a', 1), ('b', -2), ('c', -2)]]\n Constraint enforcing that the sum of variables equals the value of another variable.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\", \"c\"], [1, 2, 3])\n >>> problem.addConstraint(VariableExactSumConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), (""'b', 1), ('c', 2)], [('a', 1), ('b', 2), ('c', 3)], [('a', 2), ('b', 1), ('c', 3)]]\n >>> problem = Problem()\n >>> problem.addVariable('a', [-1,0,1])\n >>> problem.addVariable('b', [-1,0,1])\n >>> problem.addVariable('c', [0, 2])\n >>> problem.addConstraint(VariableExactSumConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -1), ('b', 1), ('c', 0)], [('a', 0), ('b', 0), ('c', 0)], [('a', 1), ('b', -1), ('c', 0)], [('a', 1), ('b', 1), ('c', 2)]]\n Constraint enforcing that the sum of variables sum at least to the value of another variable.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\", \"c\"], [1, 4])\n >>> problem.addConstraint(VariableMinSumConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1), ('c', 1)], [('a', 1), ('b', 4), ('c', 1)], [('a', 1), ('b', 4), ('c', 4)], [('a', 4), ('b', 1), ('c', 1)], [('a', 4), ('b', 1), ('c', 4)], [('a', 4), ('b', 4), ('c', 1)], [('a', 4), ('b', 4), ('c', 4)]]\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [-3, 1])\n >>> problem.addVariable('c', [-2, 2])\n >>> problem.addConstraint(VariableMinSumConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -3), ('b', 1), ('c', -2)], [('a', 1), ('b', -3), ('c', -2)], [('a', 1), ('b', 1), ('c', -2)], [('a', 1), ('b', 1), ('c', 2)]]\n Constraint enforcing that the sum of variables sum at most to the value of another variable.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\", \"c\"], [1, 3, 4])\n >>> problem.addConstraint(VariableMaxSumConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1), ('c', 3)], [('a', 1), ('b', ""1), ('c', 4)], [('a', 1), ('b', 3), ('c', 4)], [('a', 3), ('b', 1), ('c', 4)]]\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [-2, 1])\n >>> problem.addVariable('c', [-3, -1])\n >>> problem.addConstraint(VariableMaxSumConstraint('c', ['a', 'b']))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -2), ('b', -2), ('c', -3)], [('a', -2), ('b', -2), ('c', -1)], [('a', -2), ('b', 1), ('c', -1)], [('a', 1), ('b', -2), ('c', -1)]]\n Constraint enforcing that values of all given variables are different.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(AllDifferentConstraint())\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)]]\n Constraint enforcing that values of given variables are not present in the given set.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(NotInSetConstraint([1]))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 2), ('b', 2)]]\n Constraint enforcing that values of all given variables are equal.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(AllEqualConstraint())\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1)], [('a', 2), ('b', 2)]]\n Constraint enforcing that values of given variables sum exactly to a given amount.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(ExactSumConstraint(3))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)]]\n >>> pr""oblem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [-1, 0, 1])\n >>> problem.addConstraint(ExactSumConstraint(0))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -1), ('b', 1)], [('a', 0), ('b', 0)], [('a', 1), ('b', -1)]]\n Constraint enforcing that values of given variables sum at least to a given amount.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(MinSumConstraint(3))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)], [('a', 2), ('b', 2)]]\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [-3, 1])\n >>> problem.addConstraint(MinSumConstraint(-2))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -3), ('b', 1)], [('a', 1), ('b', -3)], [('a', 1), ('b', 1)]]\n Constraint enforcing that values of given variables sum up to a given amount.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(MaxSumConstraint(3))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1)], [('a', 1), ('b', 2)], [('a', 2), ('b', 1)]]\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [-3, 1])\n >>> problem.addConstraint(MaxSumConstraint(-2))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -3), ('b', -3)], [('a', -3), ('b', 1)], [('a', 1), ('b', -3)]]\n Constraint enforcing that values of given variables create a product of exactly a given amount.\n \n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(ExactProdConstraint(2))\n >>> sorted(sorted(x.items()) for x in probl""em.getSolutions())\n [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)]]\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [-2, -1, 1, 2])\n >>> problem.addConstraint(ExactProdConstraint(-2))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -2), ('b', 1)], [('a', -1), ('b', 2)], [('a', 1), ('b', -2)], [('a', 2), ('b', -1)]]\n Constraint enforcing that values of given variables create a product up to at least a given amount.\n \n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(MinProdConstraint(2))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)], [('a', 2), ('b', 2)]]\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [-2, -1, 1])\n >>> problem.addConstraint(MinProdConstraint(1))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -2), ('b', -2)], [('a', -2), ('b', -1)], [('a', -1), ('b', -2)], [('a', -1), ('b', -1)], [('a', 1), ('b', 1)]]\n Constraint enforcing that values of given variables create a product up to at most a given amount.\n \n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(MaxProdConstraint(2))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1)], [('a', 1), ('b', 2)], [('a', 2), ('b', 1)]]\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [-2, -1, 1])\n >>> problem.addConstraint(MaxProdConstraint(-1))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', -2), ('b', 1)], [('a', -1), ('b', 1)], [('a', 1), ('b', -2)], [('a', 1), ('b', -1)]]\n Constraint enforcing that values of given variables are present in the g""iven set.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(InSetConstraint([1]))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1)]]\n Constraint which wraps a function defining the constraint logic.\n\n Examples:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> def func(a, b):\n ... return b > a\n >>> problem.addConstraint(func, [\"a\", \"b\"])\n >>> problem.getSolution()\n {'a': 1, 'b': 2}\n\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> def func(a, b):\n ... return b > a\n >>> problem.addConstraint(FunctionConstraint(func), [\"a\", \"b\"])\n >>> problem.getSolution()\n {'a': 1, 'b': 2}\n >>> problem = Problem()\n >>> problem.addVariables([1, 2], [\"a\", \"b\"])\n >>> def func(x, y):\n ... return x != y\n >>> problem.addConstraint(FunctionConstraint(func), [1, 2])\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[(1, 'a'), (2, 'b')], [(1, 'b'), (2, 'a')]]\n Last multiplier must be 1, as it is the target variable.Multipliers must be numbers.Multipliers must match sum variables and +1 for target.Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.Sequence | NoneSequence[str]Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.?add_noteconstraint/constraints.pydisableenablegcint | floatisenabledlist[tuple]AllDifferentConstraintAllDifferentConstraint.__call__AllEqualConstraintAllEqualConstraint.__call__CallableCompilableFunctionConstraintCompilableFunctionConstraint.__call__CompilableFunctionConstr""aint.__init__ConstraintConstraint.__call__Constraint.forwardCheckConstraint.preProcessExactProdConstraintExactProdConstraint.__call__ExactProdConstraint.__call__..genexprExactProdConstraint.__init__ExactProdConstraint.preProcessExactProdConstraint.preProcess..genexprExactSumConstraintExactSumConstraint.__call__ExactSumConstraint.__init__ExactSumConstraint.preProcessFunctionConstraintFunctionConstraint.__call__FunctionConstraint.__init__InSetConstraintInSetConstraint.__call__InSetConstraint.__init__InSetConstraint.preProcessMaxProdConstraintMaxProdConstraint.__call__MaxProdConstraint.__call__..genexprMaxProdConstraint.__init__MaxProdConstraint.preProcessMaxProdConstraint.preProcess..genexprMaxSumConstraintMaxSumConstraint.__call__MaxSumConstraint.__init__MaxSumConstraint.preProcessMinProdConstraintMinProdConstraint.__call__MinProdConstraint.__init__MinProdConstraint.preProcessMinSumConstraintMinSumConstraint.__call__MinSumConstraint.__init__MinSumConstraint.preProcessNotInSetConstraintNotInSetConstraint.__call__NotInSetConstraint.__init__NotInSetConstraint.preProcess__Pyx_PyDict_NextRefSequenceSomeInSetConstraintSomeInSetConstraint.__call__SomeInSetConstraint.__init__SomeNotInSetConstraintSomeNotInSetConstraint.__call__SomeNotInSetConstraint.__init__UnassignedVariableExactProdConstraintVariableExactProdConstraint.__call__..genexprVariableExactProdConstraint.__call__VariableExactProdConstraint.__init__VariableExactProdConstraint._get_product_boundsVariableExactProdConstraint._safe_productVariableExactProdConstraint.preProcessVariableExactSumConstraintVariableExactSumConstraint.__call__VariableExactSumConstraint.__init__..genexprVariableExactSumConstraint.__init__VariableExactSumConstraint.preProcess..genexprVariableExactSumConstraint.preProcessVariableMaxProdConstraintVariableMaxProdConstraint.__call__..genexprVariableMaxProdConstraint.__call__VariableMaxProdConstraint.__init__VariableMaxProdConstraint._g""et_product_boundsVariableMaxProdConstraint._safe_productVariableMaxProdConstraint.preProcessVariableMaxSumConstraintVariableMaxSumConstraint.__call__VariableMaxSumConstraint.__init__..genexprVariableMaxSumConstraint.__init__VariableMaxSumConstraint.preProcess..genexprVariableMaxSumConstraint.preProcessVariableMinProdConstraintVariableMinProdConstraint.__call__..genexprVariableMinProdConstraint.__call__VariableMinProdConstraint.__init__VariableMinProdConstraint._get_product_boundsVariableMinProdConstraint._safe_productVariableMinProdConstraint.preProcessVariableMinSumConstraintVariableMinSumConstraint.__call__VariableMinSumConstraint.__init__..genexprVariableMinSumConstraint.__init__VariableMinSumConstraint.preProcess..genexprVariableMinSumConstraint.preProcessall_bounds__annotate__appendassigned_assignedassigned_prodassigned_productassignmentsasyncio.coroutinesbboolboundsc__call__candidates__class_getitem__cline_in_tracebackclosecollections.abcconstraint.constraintsconstraint.domainconstraintscontains_lt1dict__doc__domdomaindomain_boundsdomain_dictdomainsexact_exactexactprod_exactprodexactsum_exactsumexclude_varforwardCheckforwardcheckfoundfunc_func__func__genexprget_get_product_boundshihideValueindex__init___is_coroutineitemsitertoolslom__main__maxmax_othersmax_sum_missingmaxprod_maxprodmaxsum_maxsummaxval__metaclass__minmin_othersmin_sum_missingminprod_minprodminsum_minsumminvalmissingmissing_lt1missing_negative__module____mro_entries__multipliermultipliers_multipliersn_n__name__nextoother_maxother_minother_productsother_unassignedother_vars_maxother_vars_minothers_maxothers_minpparmspoppossible_maxpossible_minpossible_prodspreProcess__prepare__prodprodsproductproduct_varsproducts__qualname__removeround_safe_productseenselfsendset_set__set_name__setdefaultsinglevaluestrsumsum_other_varssum_other_vars..genexprsum_valuesum_varst_maxt_mintarget_domtarget_domaintarget_maxtarget_mintarget_valuetarget_vartemp_sum__test__th""row_unassignedunassignedunassigned_varsunassignedvariablevvalvaluevaluesvar_var_is_negative_var_max_var_minvariable_variable_contains_lt1variable_with_lt1variablesvconstraintsxzip\320\000\036\320\036:\270!\340\004\013\2103\210g\220Q\320\004\"\320\"5\3205H\310\006\310a\330\010\013\2104\210|\2307\240!\330\014\023\2201\340\010\027\220{\240!\2404\240q\330\010\033\2301\330\010\032\230!\340\010\014\210G\2204\220q\330\014\017\210t\2203\220a\330\020$\240K\250q\260\001\340\020\037\230w\240a\240q\340\010\013\210:\220Q\320\026(\250\001\330\014\037\230u\240A\320%7\260q\340\010\013\2104\210q\330\014\023\320\023$\240C\240q\360\006\000\t\031\230\002\230#\230Q\230g\240Q\240e\2503\250a\250w\260a\260u\270D\300\005\300Q\330\010\025\220Q\220d\230.\250\001\250\023\250D\260\005\260W\270B\270b\300\004\300D\310\004\310D\320PV\320VW\330\010\027\220s\320\032,\250A\330\010\027\220s\320\032,\250A\340\010\013\210=\230\002\230-\240s\250-\260r\270\021\330\014\023\2201\360\"\000\t\020\210q\320\004\"\320\"5\3205H\310\006\310a\330\010\013\2104\210|\2307\240!\330\014\023\2201\340\010\027\220{\240!\2404\240q\330\010\030\230\001\330\010\025\220Q\340\010\014\210G\2204\220q\330\014\017\210t\2203\220a\330\020!\240\033\250A\250Q\340\020\032\230'\240\021\240!\340\010\013\2104\210q\330\014\023\220>\240\023\240A\360\006\000\t\031\230\002\230#\230Q\230g\240Q\240e\2503\250a\250w\260a\260u\270D\300\005\300Q\330\010\025\220Q\220d\230.\250\001\250\023\250D\260\005\260W\270B\270b\300\004\300D\310\004\310D\320PV\320VW\330\010\031\230\021\230.\250\002\250\"\250D\260\005\260Q\330\010\013\2103\210a\320\017\037\230r\240\021\330\014\023\2201\340\010\013\2101\330\014\020\220\007\220q\330\020#\2401\240B\240d\250%\250{\270#\270R\270s\300!\330\020\023\2201\330\024\035\230R\230s\240!\2407\250!\2505\260\003\2601\260G\2701\270E\300\024\300U\310!\330\024%\240Q\240d\250.\270\001\270\023\270D\300\005\300W\310B\310b\320PT\320TX\320X\\\320\\`\320`f\320fg\340\024%\240Q\240a\340\020\031\230\027\240\001\240\021\330\020\024\220G\2306""\240\021\330\024\034\230A\230^\2502\250T\260\022\2602\260T\270\025\270a\330\024\035\230Q\330\030\036\230j\250\001\250\021\330\020\023\2204\220q\330\024\033\2301\340\010\017\210q\320\004\"\320\"5\3205H\310\006\310a\330\010\024\220D\230\001\330\010\017\210q\330\010\022\220!\330\010\026\220a\340\010\013\2103\210a\210t\320\023,\250C\250s\260!\2601\330\014\020\220\014\230A\330\020\024\320\024+\2507\260+\270Q\330\010\014\210J\320\026&\240c\250\021\250+\260T\270\021\330\014\017\210y\230\003\2301\330\020\030\230\013\2401\240A\340\020\032\230!\330\020\023\2201\330\024\037\230w\240a\240q\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\014\210D\220\010\230\004\230E\240\023\240K\250t\2603\260a\260}\300C\300r\310\024\310U\320RT\320TU\330\014\023\2201\330\010\013\2101\330\014\020\220\014\230A\330\020\023\2209\230G\240<\250u\260I\270W\300L\320PS\320SV\320VW\320Wd\320dg\320gh\330\024\035\230W\240A\240Q\330\024\030\230\t\240\026\240q\330\030\033\2305\240\002\240&\250\002\250!\330\034\"\240*\250A\250Q\330\024\027\220t\2301\330\030\037\230q\330\010\017\210q\320\004\"\320\"5\3205H\310\006\310a\340\010\014\210L\230\001\330\014\017\210y\230\007\230q\330\020\027\220q\360\006\000\t\023\220$\220a\330\010\017\210q\330\010\014\210L\230\001\330\014\024\220K\230q\240\001\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\017\210u\220C\220q\320\004\"\320\"5\3205H\310\006\310a\330\010\022\220$\220a\330\010\017\210q\330\010\022\220!\330\010\026\220a\340\010\013\2103\210a\210t\320\023,\250C\250s\260!\2601\330\014\020\220\014\230A\330\020\024\320\024+\2507\260+\270Q\330\010\014\210J\320\026&\240c\250\021\250+\260T\270\021\330\014\017\210y\230\003\2301\330\020\030\230\013\2401\240A\340\020\032\230!\330\020\023\2201\330\024\037\230w\240a\240q\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\014\210D\220\010\230\003\2303\230a\230}\250C\250s\260$\260e\2702\270Q\330\014\023\2201\330\010\013\2101\330\014\020\220\014\230A""\330\020\023\2209\230G\240<\250u\260I\270W\300L\320PS\320SV\320VW\320Wd\320dg\320gh\330\024\035\230W\240A\240Q\330\024\030\230\t\240\026\240q\330\030\033\2305\240\002\240&\250\002\250!\330\034\"\240*\250A\250Q\330\024\027\220t\2301\330\030\037\230q\330\010\017\210q\320\004\"\320\"5\3205H\310\006\310a\330\010\026\220d\230!\340\010\013\2104\210|\2307\240!\330\014\023\2201\340\010\027\220{\240!\2404\240q\330\010\024\220A\330\010\022\220!\340\010\013\2101\330\014\020\220\005\220^\2403\240a\240t\250;\260a\330\020\023\2204\220s\230!\330\024!\240\033\250A\250U\260\"\260A\340\024\036\230a\340\014\020\220\007\220t\2301\330\020\023\2204\220s\230!\330\024!\240\033\250A\250Q\340\024!\240\023\240A\240W\250A\250Q\330\024\036\230a\340\010\013\210:\220Q\220k\240\021\330\014\030\230\005\230Q\230k\250\021\340\010\013\2101\340\014\017\210z\230\022\2301\330\020\027\220q\330\014\017\210q\330\020\024\220G\2304\230q\330\024\027\220t\2307\240!\330\030!\240\027\250\001\250\021\330\030\033\2301\330\034 \240\t\250\026\250q\330 +\250:\260S\270\006\270b\300\013\3101\310D\320PY\320Y_\320_`\320`a\330 #\2409\250B\250a\330$*\250*\260A\260Q\340\034'\240z\260\022\2603\260a\260q\330\034 \240\t\250\026\250q\330 #\2409\250B\250f\260B\260a\330$*\250*\260A\260Q\330\030\033\2304\230q\330\034#\2401\330\014\023\2201\340\014\023\220:\230S\240\001\320\004\"\320\"5\3205H\310\006\310a\330\010\026\220d\230!\340\010\013\2104\210|\2307\240!\330\014\023\2201\340\010\027\220{\240!\2404\240q\330\010\024\220A\340\010\013\2101\330\014\020\220\005\220^\2403\240a\240t\250;\260a\330\020\023\2204\220s\230!\330\024!\240\033\250A\250U\260\"\260A\340\024!\240\023\240A\240W\250A\250U\260\"\260A\340\014\020\220\007\220t\2301\330\020\023\2204\220s\230!\330\024!\240\033\250A\250Q\340\024!\240\023\240A\240W\250A\250Q\340\010\013\210:\220Q\220k\240\021\330\014\030\230\005\230Q\230k\250\021\340\010\017\210z\230\023\230A\320\004\"\320\"5\3205H\310\006\310a\330\010\026\220d\230!\330\010\023\2204\220q\330\010\016\210a\330\010\032\230!""\330\010\032\230!\330\010\022\220!\330\010\033\2301\330\010\013\2101\330\014\020\220\n\230.\250\003\2501\250K\260q\330\020\023\2209\230C\230q\330\024\033\230;\240a\240z\260\022\2601\340\024'\240t\2509\260A\260Q\330\024'\240t\2509\260A\260Q\330\024\036\230a\330\024\027\220t\320\033,\250A\250Q\330\030+\2501\330\014\017\210z\230\021\230%\230q\330\020\026\220e\2301\230E\240\021\330\014\017\210t\2202\320\025%\240R\240y\260\003\2604\260r\3209I\310\022\3101\330\020\027\220q\330\014\017\210}\230D\240\010\250\004\250D\260\001\330\020\024\220J\230n\250C\250q\260\013\2701\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230t\2402\240V\2502\250[\270\002\270!\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\340\014\020\220\014\230A\330\020\023\2209\230C\230q\330\024\033\230;\240a\240q\340\024'\240t\2509\260A\260Q\330\024'\240t\2509\260A\260Q\330\024\036\230a\330\024\027\220t\320\033,\250A\250Q\330\030+\2501\330\014\017\210z\230\021\230%\230q\330\020\026\220e\2301\230E\240\021\330\014\017\210t\2202\320\025%\240R\240y\260\003\2604\260r\3209I\310\022\3101\330\020\027\220q\330\014\017\210}\230D\240\010\250\004\250D\260\001\330\020\024\220L\240\001\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230t\2402\240V\2502\250Q\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\330\010\013\2101\330\014\023\2204\220r\320\031)\250\023\250I\260T\270\024\270R\320?O\310s\320RS\340\014\023\2204\220s\230!\320\004\"\320\"5\3205H\310\006\310a\330\010\016\210d\220!\330\010\022\220!\330\010\020\220\001\330\010\014\210L\230\001\330\014\017\210y\230\003\2301\330\020\031\230\033\240A\240Z\250s\260!\340\020\033\2301\330\010\013\2101\330\014\017\210t\2201\330\020\023\2205\230\006\230c\240\024\240W\250H\260B\260a\330\024\033\2301\340\020\023\2204\220t\2302\230X\240R\240q\330\024\033\2301\330\014\017\210}\230D\240\004\240D\250\002\250&\260\003\2601\360\006\000\021\025\220L\240""\001\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230v\240W\250A\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\340\014\017\210t\2201\330\020\023\2206\230\023\230D\240\001\330\024\033\2301\340\020\023\2206\230\022\2304\230q\330\024\033\2301\330\010\017\210q\320\004\"\320\"5\3205H\310\006\310a\330\010\016\210d\220!\330\010\022\220!\330\010\020\220\001\330\010\014\210L\230\001\330\014\017\210y\230\003\2301\330\020\031\230\033\240A\240Z\250w\260a\340\020\033\2301\330\010\013\2101\330\014\017\210t\2201\330\020\023\2205\230\006\230c\240\024\240W\250H\260B\260a\330\024\033\2301\340\020\023\2204\220t\2302\230X\240R\240q\330\024\033\2301\330\014\017\210}\230D\240\004\240D\250\002\250&\260\003\2601\360\006\000\021\025\220L\240\001\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230v\240S\250\001\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\340\014\017\210t\2201\330\020\023\2206\230\023\230D\240\001\330\024\033\2301\340\020\023\2206\230\022\2304\230q\330\024\033\2301\330\010\017\210q\320\004\"\320\"5\3205H\310\006\310a\330\010\026\220d\230!\330\010\021\220\024\220Q\330\010\016\210a\330\010\022\220!\330\010\032\230!\330\010\013\2101\330\014\020\220\n\230.\250\003\2501\250K\260q\330\020\023\2209\230C\230q\330\024\033\230;\240a\240z\260\022\2601\340\024'\240t\2509\260A\260Q\330\024\036\230a\340\014\020\220\014\230A\330\020\023\2209\230C\230q\330\024\033\230;\240a\240q\340\024'\240t\2509\260A\260Q\330\024\036\230a\340\010\013\210:\220Q\220e\2301\330\014\022\220%\220q\230\005\230Q\330\010\013\2104\210r\320\021!\240\022\2401\330\014\023\2201\330\010\017\210t\2203\220g\230S\240\001\320\004\"\320\"5\3205H\310\006\310a\330\010\026\220d\230!\330\010\021\220\024\220Q\330\010\016\210a\330\010\032\230!\330\010\022\220!\330\010\033\2301\330\010\013\2101\330\014\020\220\n\230.\250\003\2501\250K\260q\330\020\023\2209\230C\230q\330\024\033\230;\240a""\240z\260\022\2601\340\024'\240t\2509\260A\260Q\330\024\036\230a\330\024\027\220t\320\033,\250A\250Q\330\030+\2501\330\014\017\210z\230\021\230%\230q\330\020\026\220e\2301\230E\240\021\330\014\017\210t\2202\320\025%\240R\240q\330\020\027\220q\330\014\017\210}\230D\240\010\250\004\250D\260\001\330\020\024\220J\230n\250C\250q\260\013\2701\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230t\2402\240V\2502\250[\270\002\270!\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\340\014\020\220\014\230A\330\020\023\2209\230C\230q\330\024\033\230;\240a\240q\340\024'\240t\2509\260A\260Q\330\024\036\230a\330\024\027\220t\320\033,\250A\250Q\330\030+\2501\330\014\017\210z\230\021\230%\230q\330\020\026\220e\2301\230E\240\021\330\014\017\210t\2202\320\025%\240R\240q\330\020\027\220q\330\014\017\210}\230D\240\010\250\004\250D\260\001\330\020\024\220L\240\001\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230t\2402\240V\2502\250Q\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\330\010\017\210q\320\004\"\320\"5\3205H\310\006\310a\360.\000\t\020\210q\320\004#\320#6\260a\360\016\000\t\r\210N\230!\330\010\014\320\014\034\230A\320\004#\320#6\260a\330\010\014\210N\230!\330\010\014\320\014\034\230A\320\004$\320$7\3207J\320Je\320ef\360&\000\t\014\2103\210a\210{\230#\230Q\330\014\027\220y\240\001\240\021\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2204\220t\2301\230K\240z\260\032\2701\330\024\032\230'\240\021\240!\330\014\027\220w\230b\240\006\240a\330\014\030\230\001\230\031\240'\250\022\2506\260\021\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\360\006\000\t\r\320\0146\260a\330\010\034\230A\330\010\014\210L\230\001\330\014\036\230g\240Q\330\014\020\320\020'\240w\250a\250q\330\010\014\210J\320\026&\240c\250\021\250+\260T\270\021\330\014\017\210}\230C\230q\330\020\023\320\023%\240W\250A\340\024""\025\330\020$\240A\360\006\000\t\025\220D\230\001\330\010\014\210L\230\001\330\014\017\320\017!\240\027\250\005\250T\3201C\3003\300a\330\020\021\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\022\2301\330\024\032\230'\240\021\240!\330\025\033\2303\230b\240\004\240J\250c\260\021\330\024\032\230'\240\021\240!\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\360\006\000\t\r\320\0146\260a\330\010\034\230A\330\010\014\210L\230\001\330\014\036\230g\240Q\330\014\020\320\020'\240w\250a\250q\330\010\014\210J\320\026&\240c\250\021\250+\260T\270\021\330\014\017\210}\230C\230q\330\020\023\320\023%\240W\250A\340\024\025\330\020$\240A\360\006\000\t\023\220$\220a\330\010\014\210L\230\001\330\014\017\320\017!\240\027\250\005\250T\3201C\3003\300a\330\020\021\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\022\2301\330\024\032\230'\240\021\240!\330\025\033\2303\230b\240\004\240H\250B\250a\330\024\032\230'\240\021\240!\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\330\010\025\220W\230A\230T\240\021\330\010\020\220\003\2201\220A\340\010\014\210G\2204\220q\330\014\030\230\r\240T\320)=\270Q\270i\300|\320ST\330\014\022\220'\230\021\230!\330\014\020\220\007\220s\230!\330\020!\240\021\240$\240b\250\014\260D\270\002\270!\330\020\023\2203\220a\320\027'\240r\250\021\330\024\027\220w\230a\230q\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\360\006\000\t\023\220$\220a\330\010\014\210L\230\001\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\023\230B\230d\240(\250\"\250A\330\024\032\230'\240\021\240!\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\340\010\026\220d\230!\340\010\013\2101\330\014\020\220\005\220^\2403\240a\240t\250;\260a\330\020\031\230\027\240\001\240\021\330\020\024\220I\230V\2401\330\024\027\220v\230R\230{\250\"\250C\250q\260\007\260q\270\004\270A\330\030""\036\230g\240Q\240a\340\014\020\220\007\220t\2301\330\020\031\230\027\240\001\240\021\330\020\035\230S\240\004\240A\330\020\035\230S\240\004\240A\330\020\024\220I\230V\2401\330\024\027\220v\230R\230{\250\"\250C\250q\260\007\260q\270\004\270A\330\030\036\230g\240Q\240a\330\024\027\220v\230R\230{\250\"\250C\250q\260\007\260q\270\004\270A\330\030\036\230g\240Q\240a\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\330\010\026\220d\320\032+\2504\320/B\300!\3005\310\003\3101\310A\330\010\023\2204\220q\330\010\014\210L\230\002\230*\240C\240q\250\007\250q\260\013\2702\270[\310\004\310J\320Vd\320dg\320gh\320hs\320st\330\010\014\210L\230\002\230*\240C\240q\250\007\250q\260\013\2702\270[\310\004\310J\320Vd\320dg\320gh\320hs\320st\360\006\000\t\r\210J\220n\240C\240q\250\013\2601\330\014\025\220W\230A\230Q\330\014\035\230^\2501\250K\260z\300\024\300Q\330\014\035\230^\2501\250K\260z\300\024\300Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\022\230;\240b\250\017\260r\270\021\330\024\032\230'\240\021\240!\330\020\023\2206\230\022\230;\240b\250\017\260r\270\021\330\024\032\230'\240\021\240!\360\006\000\t\r\210L\230\002\230*\240C\240q\250\007\250q\260\013\2702\270^\3103\310a\310w\320VW\320Wb\320bd\320dk\320km\320mq\320q{\360\000\000|\001J\002\360\000\000J\002M\002\360\000\000M\002N\002\360\000\000N\002Y\002\360\000\000Y\002Z\002\330\010\014\210L\230\002\230*\240C\240q\250\007\250q\260\013\2702\270^\3103\310a\310w\320VW\320Wb\320bd\320dk\320km\320mq\320q{\360\000\000|\001J\002\360\000\000J\002M\002\360\000\000M\002N\002\360\000\000N\002Y\002\360\000\000Y\002Z\002\330\010\014\320\014 \240\002\240*\250D\260\t\270\021\270*\300B\300b\310\004\310L\320XY\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\330\010\026\220d\320\032+\2504\320/B\300!\3005\310\003\3101\310A\330\010\014\210L\230\002\230*\240C\240q\250\007\250q\260\013\2702\270[\310\004\310J\320Vd\320dg\320gh\320hs\320st\360\006\000\t\r\210J\220n\240C\240q\250""\013\2601\330\014\025\220W\230A\230Q\330\014\031\230\036\240q\250\013\260:\270T\300\021\330\014\020\220\t\230\026\230q\330\020\023\2206\230\022\230;\240b\250\013\2602\260T\270\021\330\024\032\230'\240\021\240!\360\006\000\t\r\210L\230\002\230*\240C\240q\250\007\250q\260\013\2702\270^\3103\310a\310w\320VW\320Wb\320bd\320dk\320km\320mq\320q{\360\000\000|\001J\002\360\000\000J\002M\002\360\000\000M\002N\002\360\000\000N\002Y\002\360\000\000Y\002Z\002\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\330\010\026\220d\320\032+\2504\320/B\300!\3005\310\003\3101\310A\330\010\021\220\024\220Q\330\010\014\210L\230\002\230*\240C\240q\250\007\250q\260\013\2702\270[\310\004\310J\320Vd\320dg\320gh\320hs\320st\360\006\000\t\r\210J\220n\240C\240q\250\013\2601\330\014\025\220W\230A\230Q\330\014\035\230^\2501\250K\260z\300\024\300Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\022\230;\240b\250\017\260r\270\021\330\024\032\230'\240\021\240!\360\006\000\t\r\210L\230\002\230*\240C\240q\250\007\250q\260\013\2702\270^\3103\310a\310w\320VW\320Wb\320bd\320dk\320km\320mq\320q{\360\000\000|\001J\002\360\000\000J\002M\002\360\000\000M\002N\002\360\000\000N\002Y\002\360\000\000Y\002Z\002\330\010\014\320\014 \240\002\240*\250D\260\t\270\021\270*\300B\300b\310\004\310L\320XY\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\340\010\026\220d\230!\340\010\013\2104\210q\330\014\020\220\007\220t\2301\330\020\031\230\027\240\001\240\021\330\020\035\230S\240\004\240A\330\020\024\220I\230V\2401\330\024\027\220v\230R\230{\250\"\250C\250q\260\007\260q\270\004\270A\330\030\036\230g\240Q\240a\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\340\010\030\230\007\230q\240\004\240A\330\010\025\220S\230\001\230\021\330\010\025\220S\230\001\230\021\330\010\014\210G\2204\220q\330\014\027\220|\2404\320';\2701\270I\300\\\320QR\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\035\230Q\230f\240B\240k""\260\026\260r\270\021\330\020\030\230\t\240\023\240A\240]\260#\260Q\260a\330\020\023\2207\230\"\230K\240s\250'\260\022\2601\330\024\032\230'\240\021\240!\320\004$\320$7\3207J\320Je\320ef\330\010\016\210d\220!\330\010\014\210L\230\001\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\027\240\001\330\024\032\230'\240\021\240!\330\014\030\230\001\230\031\240'\250\022\2506\260\021\330\010\023\2207\230\"\230F\240!\320\004$\320$7\3207J\320Je\320ef\330\010\016\210d\220!\330\010\014\210L\230\001\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\023\230A\330\024\032\230'\240\021\240!\330\014\030\230\001\230\031\240'\250\022\2506\260\021\330\010\023\2207\230\"\230F\240!\320\0048\3208X\320XY\330\010\016\320\016!\240\021\240!\320\0048\270\001\340\010\016\210l\230!\2301\320\004&\320&9\3209L\320L^\320^_\360$\000\t\036\230Q\330\010\014\210L\230\001\330\014\017\210y\230\007\230q\330\020\023\320\023&\240c\250\021\330\024)\250\021\340\024\025\340\014\017\320\017\"\240'\250\021\360\006\000\021\032\230\027\240\001\240\021\330\020\023\2201\330\024\030\230\t\240\026\240q\330\030#\2401\320$:\270!\330\030\033\2304\230t\2401\240K\250y\270\001\330\034\"\240*\250A\250Q\330\024\030\230\013\2401\240A\330\020\023\2204\220q\330\024\033\2301\330\010\017\210q\240A\250A\200A\340\023\024\330\021\022\330\025\026\330\010\t\330\024\025\360>\000\t\025\220A\330\010\022\220!\330\010\014\210E\220\021\330\014\017\210r\220\023\220A\330\020\025\220W\230A\230[\250\001\250\021\340\020\025\220W\230A\230Q\330\020\033\2301\360\006\000\t\014\2108\2202\220Q\330\014\024\220D\230\013\2403\240d\250&\260\002\260(\270!\330\020\024\220M\240\023\240H\250C\250r\260\023\260D\270\r\300Q\300k\320QZ\320Z[\340\010\017\210t\2206\230\022\2301\200A\360\014\000\t\r\210H\220A\200A\340\023\024\330\021\022\330\025\026\330\010\t\330\024\025\340\010\026\220a\330\010\014\210L\230\001\330\014\024\220K\230t\2401\240J\250a\330\014\017\210|\2303\230a\330\020\036\230a\330\021\027\220w""\230l\250$\250f\260C\260q\330\020\027\220q\330\010\013\210=\230\004\230L\250\007\250q\330\014\020\220\014\230A\330\020\023\2209\230G\2401\330\024\035\230W\240A\240Q\330\024\027\220|\2407\250!\330\030\037\230q\330\024\030\230\t\240\026\240q\330\030\033\2306\240\023\240A\330\034\"\240*\250A\250Q\330\010\017\210q\200A\330\010\017\210q\330\010\014\210E\220\021\330\014\024\220A\330\010\017\210q\200A\340\023\024\330\021\022\330\025\026\330\010\t\330\024\025\340\010\017\210q\330\010\014\210L\230\001\330\014\024\220K\230t\2401\240J\250a\330\014\017\210v\220W\230A\330\020\023\2206\230\023\230A\330\024\033\2301\330\020\024\220A\220Y\230a\330\010\013\2101\330\014\020\220\014\230A\330\020\023\2209\230G\2401\330\024\035\230W\240A\240Q\330\024\030\230\t\240\021\330\030\033\2306\240\023\240A\330\034\"\240*\250A\250Q\330\034\037\230t\2401\330 '\240q\330\010\017\210q\320\004\034\230E\240\021\360\024\000\t\r\210H\220A\330\010\014\210F\220!\330\010\014\210J\220a\320\004 \240\001\360\014\000\t\r\210L\230\001\320\004 \240\001\360\014\000\t\r\210L\230\001\330\010\014\320\0146\260a\320\004\037\230}\250M\270\021\360\022\000\t\r\210K\220q\330\010\014\320\014\034\230A\330\010\014\210L\230\001\320\004\037\230}\250M\270\021\360\022\000\t\r\210K\220q\330\010\014\320\014\034\230A\330\010\014\210L\230\001\330\010\014\320\014 \240\001\320\004\"\240!\360\014\000\t\r\210N\230!\330\010\014\320\0146\260a\240Q\270Q\230Q\220Q\320\004\035\230U\240*\250A\330\010\014\210I\220Q\330\010\014\210M\230\021\320\004\035\230Z\240z\260\021\360\022\000\t\r\210I\220Q\330\010\014\210M\230\021\240\021\320\004#\240?\260/\300\035\310a\360\024\000\t\r\210N\230!\330\010\014\210L\230\001\330\010\014\320\014\034\230A\340\010\013\2101\330\014\023\2203\220a\220}\240C\240s\250!\250:\260R\260s\270!\330\014!\320!J\310!\330\014\023\220;\230b\240\003\2403\240c\250\021\320\004!\240\035\250m\2701\360\022\000\t\r\210M\230\021\330\010\014\320\014\034\230A\330\010\014\210L\230\001\330\010\014\210L\230\001\330\010\014\320\014 \240\001""\320\004/\250q\330\010\021\220\021\330\010\014\210G\2204\220q\330\014\017\210t\2203\220a\330\020\021\330\014\022\220+\230Q\230a\330\014\017\210t\2201\330\020\021\330\014\022\220'\230\022\2303\230a\230v\240S\250\001\250\021\340\010\013\2104\210q\330\014\023\2203\220a\360\006\000\t\026\220Q\220b\230\004\230E\240\027\250\002\250\"\250D\260\004\260D\270\004\270F\300!\330\010\023\2201\220D\230\016\240a\240s\250$\250e\2601\330\010\017\210s\220!\220;\230c\240\021\240!\320\004/\250q\340\010\021\220\021\330\010\014\210G\2204\220q\330\014\017\210t\2203\220a\330\020\021\330\014\022\220+\230Q\230a\330\014\017\210t\2201\330\020\021\330\014\022\220'\230\022\2303\230a\230v\240S\250\001\250\021\340\010\025\220Q\220b\230\004\230E\240\021\330\010\013\2104\210q\330\014\023\2203\220a\360\006\000\t\026\220Q\220b\230\004\230E\240\027\250\002\250\"\250D\260\004\260D\270\004\270F\300!\330\010\023\2201\220D\230\016\240a\240s\250$\250e\2601\330\010\017\210s\220!\220;\230c\240\021\240!"; + PyObject *data = NULL; + CYTHON_UNUSED_VAR(__Pyx_DecompressString); + #endif + PyObject **stringtab = __pyx_mstate->__pyx_string_tab; + Py_ssize_t pos = 0; + for (int i = 0; i < 293; i++) { + Py_ssize_t bytes_length = index[i].length; + PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL); + if (likely(string) && i >= 39) PyUnicode_InternInPlace(&string); + if (unlikely(!string)) { + Py_XDECREF(data); + __PYX_ERR(0, 1, __pyx_L1_error) + } + stringtab[i] = string; + pos += bytes_length; + } + for (int i = 293; i < 349; i++) { + Py_ssize_t bytes_length = index[i].length; + PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); + stringtab[i] = string; + pos += bytes_length; + if (unlikely(!string)) { + Py_XDECREF(data); + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + Py_XDECREF(data); + for (Py_ssize_t i = 0; i < 349; i++) { + if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = stringtab + 293; + for (Py_ssize_t i=0; i<56; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif + } + { + PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0; + int8_t const cint_constants_1[] = {0,1,10}; + for (int i = 0; i < 3; i++) { + numbertab[i] = PyLong_FromLong(cint_constants_1[i - 0]); + if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_number_tab; + for (Py_ssize_t i=0; i<3; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_codeobjects ### */ -\ - typedef struct { - unsigned int argcount : 3; - unsigned int num_posonly_args : 1; - unsigned int num_kwonly_args : 1; - unsigned int nlocals : 6; - unsigned int flags : 10; - unsigned int first_line : 11; - unsigned int line_table_length : 14; - } __Pyx_PyCode_New_function_description; +typedef struct { + unsigned int argcount : 3; + unsigned int num_posonly_args : 1; + unsigned int num_kwonly_args : 1; + unsigned int nlocals : 5; + unsigned int flags : 10; + unsigned int first_line : 11; +} __Pyx_PyCode_New_function_description; /* NewCodeObj.proto */ static PyObject* __Pyx_PyCode_New( const __Pyx_PyCode_New_function_description descr, PyObject * const *varnames, PyObject *filename, PyObject *funcname, - const char *line_table, + PyObject *line_table, PyObject *tuple_dedup_map ); @@ -45949,379 +48433,394 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { PyObject* tuple_dedup_map = PyDict_New(); if (unlikely(!tuple_dedup_map)) return -1; { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 393, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 433}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_m}; - __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 410, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 450}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_v}; - __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 411, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 451}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_v}; - __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 540, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 615}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_m}; - __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 551, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 626}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_v}; - __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 614, 2}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 710, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 794}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_m}; - __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 721, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 805}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_v}; - __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 780, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 870}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 913, 2}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c}; - __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 899}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 914, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1013}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c}; - __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 928, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1014}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c}; - __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1070, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1182}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_p}; - __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1222}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1104, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1251}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1241, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1369}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_p}; - __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 1573}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_v}; + __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 11, 20}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 12}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck}; - __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 36, 109}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 37}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_3a_Q_y_WAQ_q_4t1Kz_1_wb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_3a_Q_y_WAQ_q_4t1Kz_1_wb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 64, 151}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 65}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_unassigned, __pyx_mstate->__pyx_n_u_unassignedvariable, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_forwardCheck, __pyx_k_99LL___Q_L_y_q_c_1_q_1_4t1Ky_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_forwardCheck, __pyx_mstate->__pyx_kp_b_iso88591_99LL___Q_L_y_q_c_1_q_1_4t1Ky_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 126, 25}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 134}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_func, __pyx_mstate->__pyx_n_u_assigned}; - __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_Zz_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_Zz_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 138, 142}; + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 146}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_unassigned, __pyx_mstate->__pyx_n_u_parms, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_x}; - __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_A_A_E_r_A_WA_WAQ_1_82Q_D_3d_M_HC, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_A_A_E_r_A_WA_WAQ_1_82Q_D_3d_M_HC, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 194, 23}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 202}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_func, __pyx_mstate->__pyx_n_u_assigned}; - __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_U_A_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_U_A_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 198, 19}; + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 206}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_unassigned}; - __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_88XXY, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_88XXY, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 213, 146}; + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 221}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_unassigned, __pyx_mstate->__pyx_n_u_seen, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_domain}; - __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_A_q_L_Kt1Ja_vWA_6_A_1_AYa_1_A_9G, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_A_q_L_Kt1Ja_vWA_6_A_1_AYa_1_A_9G, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 251, 160}; + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 259}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_unassigned, __pyx_mstate->__pyx_n_u_singlevalue, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_domain}; - __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_A_a_L_Kt1Ja_3a_a_wl_fCq_q_L_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_A_a_L_Kt1Ja_3a_a_wl_fCq_q_L_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 289, 27}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 302}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exactsum, __pyx_mstate->__pyx_n_u_multipliers}; - __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_4M_M_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_m1_M_A_L_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 301, 149}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_exactsum, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_d_4q_1_1Kq_IV1_v, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 22, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 317}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_exactsum, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_other_vars_min, __pyx_mstate->__pyx_n_u_other_vars_max, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_variable}; + __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_4q_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 318, 375}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_exactsum, __pyx_mstate->__pyx_n_u_sum, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_d_4q_a_1_1Kq_9Cq_az_1_a_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 340}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_exactsum, __pyx_mstate->__pyx_n_u_sum, __pyx_mstate->__pyx_n_u_min_sum_missing, __pyx_mstate->__pyx_n_u_max_sum_missing, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_missing_negative, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_d_4q_a_1_1_1Kq_9Cq_az_1_t, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 377, 86}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 417}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_target_var, __pyx_mstate->__pyx_n_u_sum_vars, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_a_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_a_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 396, 220}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 436}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_others_min, __pyx_mstate->__pyx_n_u_others_max, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_d_1_3at_a_IV1_vR, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_1_3at_a_IV1_vR, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 418, 347}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 458}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_target_value, __pyx_mstate->__pyx_n_u_sum_value, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_temp_sum}; - __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 481, 27}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 526}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_minsum, __pyx_mstate->__pyx_n_u_multipliers}; - __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_2_q_Kq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_M_Kq_A_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 493, 135}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_minsum, __pyx_mstate->__pyx_n_u_sum, __pyx_mstate->__pyx_n_u_multiplier}; - __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_L_y_q_q_d_Q_a_1_1Kq_Rq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 539}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_others_max, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier}; + __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_L_Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 524, 86}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 555}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_minsum, __pyx_mstate->__pyx_n_u_sum, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_max_sum_missing, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier}; + __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_d_Q_a_1_1Kq_9Cq_az_1_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 599}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_target_var, __pyx_mstate->__pyx_n_u_sum_vars, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_a_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_a_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 543, 114}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 618}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_others_max, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_d_4q_t1_S_A_IV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4q_t1_S_A_IV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 556, 184}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 631}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_target_value, __pyx_mstate->__pyx_n_u_sum_value, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_multiplier}; - __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 595, 27}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 675}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxsum, __pyx_mstate->__pyx_n_u_multipliers}; - __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_2_q_Kq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_M_Kq_A_L_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 607, 257}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_variable_contains_negative, __pyx_mstate->__pyx_n_u_variable_with_negative, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_contains_negative, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_maxsum, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_6Q_L_7_gQa_q_d_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 689}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_maxsum, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_other_vars_min, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_variable}; + __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4_B_5_1A_Q_L_C, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 642, 334}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_maxsum, __pyx_mstate->__pyx_n_u_sum, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_d_Q_a_1_1Kq_9Cq_az_1_z_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 707}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_maxsum, __pyx_mstate->__pyx_n_u_sum, __pyx_mstate->__pyx_n_u_min_sum_missing, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_missing_negative, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_d_Q_a_1_1_1Kq_9Cq_az_1_t9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 694, 86}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 778}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_target_var, __pyx_mstate->__pyx_n_u_sum_vars, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_a_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_a_N_L_A_1_3a_Cs_Rs_J_b_3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 713, 114}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 797}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_others_min, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_d_4q_t1_S_A_IV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_QfKy_Q_d_4q_t1_S_A_IV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 726, 184}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 810}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_target_value, __pyx_mstate->__pyx_n_u_sum_value, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_multiplier}; - __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_d_4_7_1_4q_A_1_3at_a_4s_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 765, 14}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 854}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exactprod}; - __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_N, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_N_6a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 773, 216}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 863}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_variable_with_lt1, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_contains_lt1, __pyx_mstate->__pyx_n_u_exactprod, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 801, 258}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_exactprod, __pyx_mstate->__pyx_n_u_prod, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_missing_lt1, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_contains_lt1, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_D_q_a_J_c_T_y_1_1A_1_waq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 891}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_exactprod, __pyx_mstate->__pyx_n_u_prod, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_missing_lt1, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_contains_lt1, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_D_q_a_3at_Cs_1_A_7_Q_J_c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 839, 25}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 939}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_target_var, __pyx_mstate->__pyx_n_u_product_vars}; - __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_6a_N_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_6a_N_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 849, 161}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 949}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domain_dict, __pyx_mstate->__pyx_n_u_exclude_var, __pyx_mstate->__pyx_n_u_bounds, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_dom, __pyx_mstate->__pyx_n_u_all_bounds, __pyx_mstate->__pyx_n_u_candidates, __pyx_mstate->__pyx_n_u_products, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_lo, __pyx_mstate->__pyx_n_u_hi, __pyx_mstate->__pyx_n_u_p}; - __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_get_product_bounds, __pyx_k_q_G4q_t3a_Qa_t1_3avS_Qb_E_4q_3a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_get_product_bounds, __pyx_mstate->__pyx_kp_b_iso88591_q_G4q_t3a_Qa_t1_3avS_Qb_E_4q_3a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 869, 24}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 969}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_prod, __pyx_mstate->__pyx_n_u_v}; - __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_safe_product, __pyx_k_A_q_E_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_safe_product, __pyx_mstate->__pyx_kp_b_iso88591_A_q_E_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 875, 167}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 975}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_target_domain, __pyx_mstate->__pyx_n_u_target_min, __pyx_mstate->__pyx_n_u_target_max, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_other_min, __pyx_mstate->__pyx_n_u_other_max, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_candidates, __pyx_mstate->__pyx_n_u_minval, __pyx_mstate->__pyx_n_u_maxval}; - __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_q_A_S_S_G4q_4_1I, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_QfKy_Q_q_A_S_S_G4q_4_1I, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 32, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 890, 427}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_target_value, __pyx_mstate->__pyx_n_u_assigned_product, __pyx_mstate->__pyx_n_u_unassigned_vars, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_domain_bounds, __pyx_mstate->__pyx_n_u_candidates, __pyx_mstate->__pyx_n_u_possible_min, __pyx_mstate->__pyx_n_u_possible_max, __pyx_mstate->__pyx_n_u_others, __pyx_mstate->__pyx_n_u_others_bounds, __pyx_mstate->__pyx_n_u_other_products, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lo, __pyx_mstate->__pyx_n_u_hi, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lo, __pyx_mstate->__pyx_n_u_hi, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_4_7_1_4q_1_G4q_t3a_Kq_waq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 990}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_target_value, __pyx_mstate->__pyx_n_u_assigned_product, __pyx_mstate->__pyx_n_u_unassigned_vars, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_domain_bounds, __pyx_mstate->__pyx_n_u_candidates, __pyx_mstate->__pyx_n_u_possible_min, __pyx_mstate->__pyx_n_u_possible_max, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lo, __pyx_mstate->__pyx_n_u_hi, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_4_7_1_4q_1_G4q_t3a_Kq_waq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 947, 14}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1053}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_minprod}; - __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 955, 92}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1061}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_minprod, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_a_L_WAQ_q_6_Bd_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_QfKy_Q_a_L_WAQ_q_6_Bd_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 966, 95}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1072}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_minprod, __pyx_mstate->__pyx_n_u_prod}; - __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_L_y_q_q_a_q_L_Kq_QfA_5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_L_y_q_q_a_q_L_Kq_QfA_5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 993, 23}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1105}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_target_var, __pyx_mstate->__pyx_n_u_product_vars}; - __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_6a_N_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_6a_N_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 997, 148}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1109}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domain_dict, __pyx_mstate->__pyx_n_u_exclude_var, __pyx_mstate->__pyx_n_u_bounds, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_dom, __pyx_mstate->__pyx_n_u_candidates, __pyx_mstate->__pyx_n_u_products, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lo, __pyx_mstate->__pyx_n_u_hi, __pyx_mstate->__pyx_n_u_p}; - __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_get_product_bounds, __pyx_k_q_G4q_t3a_Qa_t1_3avS_4q_3a_Qb_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_get_product_bounds, __pyx_mstate->__pyx_kp_b_iso88591_q_G4q_t3a_Qa_t1_3avS_4q_3a_Qb_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1015, 24}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1127}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_prod, __pyx_mstate->__pyx_n_u_v}; - __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_safe_product, __pyx_k_A_q_E_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_safe_product, __pyx_mstate->__pyx_kp_b_iso88591_A_q_E_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1021, 138}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1133}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_target_dom, __pyx_mstate->__pyx_n_u_t_min, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_min_others, __pyx_mstate->__pyx_n_u_max_others, __pyx_mstate->__pyx_n_u_dom, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_possible_prods}; - __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_WAT_1A_G4q_T_Qi, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_QfKy_Q_WAT_1A_G4q_T_Qi, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1034, 395}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1146}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_target_value, __pyx_mstate->__pyx_n_u_assigned_prod, __pyx_mstate->__pyx_n_u_unassigned_2, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_domain_bounds, __pyx_mstate->__pyx_n_u_candidates, __pyx_mstate->__pyx_n_u_possible_prods, __pyx_mstate->__pyx_n_u_other_unassigned, __pyx_mstate->__pyx_n_u_bounds, __pyx_mstate->__pyx_n_u_other_products, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_prods, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lo, __pyx_mstate->__pyx_n_u_hi, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lo, __pyx_mstate->__pyx_n_u_hi, __pyx_mstate->__pyx_n_u_o, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_4_7_1_4q_Q_G4q_t3a_AQ_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_4_7_1_4q_Q_G4q_t3a_AQ_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1089, 14}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1206}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxprod}; - __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_L_6a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1097, 216}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1215}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_variable_with_lt1, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_contains_lt1, __pyx_mstate->__pyx_n_u_maxprod, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_QfKy_Q_6a_A_L_gQ_waq_J_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1125, 248}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_maxprod, __pyx_mstate->__pyx_n_u_prod, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_missing_lt1, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_contains_lt1, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_a_q_a_J_c_T_y_1_1A_1_waq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1243}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_maxprod, __pyx_mstate->__pyx_n_u_prod, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_missing_lt1, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_contains_lt1, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_a_q_a_3at_Cs_1_A_7_Q_J_c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1164, 23}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1292}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_target_var, __pyx_mstate->__pyx_n_u_product_vars}; - __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_6a_N_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_6a_N_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1168, 148}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1296}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domain_dict, __pyx_mstate->__pyx_n_u_exclude_var, __pyx_mstate->__pyx_n_u_bounds, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_dom, __pyx_mstate->__pyx_n_u_candidates, __pyx_mstate->__pyx_n_u_products, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lo, __pyx_mstate->__pyx_n_u_hi, __pyx_mstate->__pyx_n_u_p}; - __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_get_product_bounds, __pyx_k_q_G4q_t3a_Qa_t1_3avS_4q_3a_Qb_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_get_product_bounds, __pyx_mstate->__pyx_kp_b_iso88591_q_G4q_t3a_Qa_t1_3avS_4q_3a_Qb_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1186, 24}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1314}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_prod, __pyx_mstate->__pyx_n_u_v}; - __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_safe_product, __pyx_k_A_q_E_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_safe_product, __pyx_mstate->__pyx_kp_b_iso88591_A_q_E_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1192, 138}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1320}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_target_dom, __pyx_mstate->__pyx_n_u_t_max, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_min_others, __pyx_mstate->__pyx_n_u_max_others, __pyx_mstate->__pyx_n_u_dom, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_possible_prods}; - __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_WAT_1A_G4q_T_Qi, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_QfKy_Q_WAT_1A_G4q_T_Qi, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1205, 395}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1333}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_target_value, __pyx_mstate->__pyx_n_u_assigned_prod, __pyx_mstate->__pyx_n_u_unassigned_2, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_domain_bounds, __pyx_mstate->__pyx_n_u_candidates, __pyx_mstate->__pyx_n_u_possible_prods, __pyx_mstate->__pyx_n_u_other_unassigned, __pyx_mstate->__pyx_n_u_bounds, __pyx_mstate->__pyx_n_u_other_products, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_prods, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lo, __pyx_mstate->__pyx_n_u_hi, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lo, __pyx_mstate->__pyx_n_u_hi, __pyx_mstate->__pyx_n_u_o, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_4_7_1_4q_Q_G4q_t3a_AQ_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_4_7_1_4q_Q_G4q_t3a_AQ_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1260, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1388}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; - __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1268, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1396}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck}; - __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_8_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_8_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1272, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1400}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_d_L_WAQ_q_6_6_7_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_d_L_WAQ_q_6_6_7_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1294, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1422}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; - __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1302, 14}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1430}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck}; - __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_8_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_8_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1306, 91}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1434}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_d_L_WAQ_q_6_A_6_7_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_mstate->__pyx_kp_b_iso88591_77JJeef_d_L_WAQ_q_6_A_6_7_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[72])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1328, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1456}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_exact}; - __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_E_HA_F_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[73] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_E_HA_F_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1342, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1470}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_found, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_d_L_y_1_AZs_1_1_t1_5_c_WH, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[72])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[74] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_d_L_y_1_AZs_1_1_t1_5_c_WH, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[74])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1390, 30}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1518}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_exact}; - __pyx_mstate_global->__pyx_codeobj_tab[73] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_E_HA_F_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[75] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_E_HA_F_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[75])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1404, 249}; + const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1532}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_found, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[74] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_d_L_y_1_AZwa_1_1_t1_5_c_W, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[74])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[76] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_mstate->__pyx_kp_b_iso88591_55H_a_d_L_y_1_AZwa_1_1_t1_5_c_W, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[76])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1571}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[77] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_sum_other_vars, __pyx_mstate->__pyx_kp_b_iso88591_3gQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; @@ -46334,27 +48833,42 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitGlobals(void) { /* PythonCompatibility.init */ if (likely(__Pyx_init_co_variables() == 0)); else - -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + /* CommonTypesMetaclass.init */ + if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* CachedMethodType.init */ #if CYTHON_COMPILING_IN_LIMITED_API -{ - PyObject *typesModule=NULL; - typesModule = PyImport_ImportModule("types"); - if (typesModule) { - __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - } -} // error handling follows -#endif + { + PyObject *typesModule=NULL; + typesModule = PyImport_ImportModule("types"); + if (typesModule) { + __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + } + } // error handling follows + #endif + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + /* CythonFunctionShared.init */ + if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + /* Generator.init */ + if (likely(__pyx_Generator_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -46395,7 +48909,7 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { } #endif -/* PyErrExceptionMatches */ +/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; @@ -46436,7 +48950,7 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta } #endif -/* PyErrFetchRestore */ +/* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 @@ -46495,7 +49009,7 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject } #endif -/* PyObjectGetAttrStr */ +/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); @@ -46505,7 +49019,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject } #endif -/* PyObjectGetAttrStrNoError */ +/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare @@ -46544,7 +49058,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { return result; } -/* TupleAndListFromArray */ +/* TupleAndListFromArray (used by fastcall) */ #if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) @@ -46557,11 +49071,11 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; for (i = 0; i < n; i++) { - if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { + Py_INCREF(src[i]); + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) { Py_DECREF(res); return NULL; } - Py_INCREF(src[i]); } return res; } @@ -46600,7 +49114,7 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) } #endif -/* BytesEquals */ +/* BytesEquals (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) @@ -46648,7 +49162,7 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq #endif } -/* UnicodeEquals */ +/* UnicodeEquals (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); @@ -46783,120 +49297,7 @@ CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, Py #endif #endif -/* RaiseDoubleKeywords */ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); -} - -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; - PyObject *kwdefs; - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { - return NULL; - } - if ( - co->co_kwonlyargcount == 0 && - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); - kwdefs = PyFunction_GET_KW_DEFAULTS(func); - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif - -/* PyObjectCall */ +/* PyObjectCall (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; @@ -46916,7 +49317,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg } #endif -/* PyObjectCallMethO */ +/* PyObjectCallMethO (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; @@ -46936,7 +49337,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject } #endif -/* PyObjectFastCall */ +/* PyObjectFastCall (used by PyObjectCallOneArg) */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; @@ -46960,7 +49361,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * con #elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { PyTypeObject *tp = Py_TYPE(callable); - #if defined(__Pyx_CyFunction_USED) + #if defined(__Pyx_CyFunction_USED) && CYTHON_METH_FASTCALL if (__Pyx_CyFunction_CheckExact(callable)) { return __Pyx_CyFunction_func_vectorcall(callable); } @@ -46991,38 +49392,16 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return __Pyx_PyObject_CallMethO(func, args[0]); } #endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); - } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); - } - } - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); - } - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); - } - #endif - #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API - vectorcallfunc f = __Pyx_PyVectorcall_Function(func); - if (f) { - return f(func, args, _nargs, NULL); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, _nargs, NULL); - } - #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL - return PyObject_Vectorcall(func, args, _nargs, NULL); + #if CYTHON_VECTORCALL + #if CYTHON_COMPILING_IN_LIMITED_API + return PyObject_Vectorcall(func, args, _nargs, NULL); + #else + vectorcallfunc f = __Pyx_PyVectorcall_Function(func); + if (f) { + return f(func, args, _nargs, NULL); + } + #endif #endif } if (nargs == 0) { @@ -47035,7 +49414,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } -/* UnpackUnboundCMethod */ +/* PyObjectCallOneArg (used by CallUnboundCMethod0) */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *result; @@ -47120,6 +49505,121 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { return 0; } +/* CallUnboundCMethod0 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + if (likely(cfunc->flag == METH_NOARGS)) + return __Pyx_CallCFunction(cfunc, self, NULL); + if (likely(cfunc->flag == METH_FASTCALL)) + return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0); + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL); + if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS))) + return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (cfunc->flag == METH_VARARGS) + return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple); + return __Pyx__CallUnboundCMethod0(cfunc, self); + } +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + else if (unlikely(was_initialized == 1)) { + __Pyx_CachedCFunction tmp_cfunc = { +#ifndef __cplusplus + 0 +#endif + }; + tmp_cfunc.type = cfunc->type; + tmp_cfunc.method_name = cfunc->method_name; + return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self); + } +#endif + PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} +#endif +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *result; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; + result = __Pyx_PyObject_CallOneArg(cfunc->method, self); + return result; +} + +/* py_dict_items (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d); +} + +/* py_dict_values (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d); +} + +/* OwnedDictNext (used by ParseKeywordsImpl) */ +#if CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) { + PyObject *next = NULL; + if (!*ppos) { + if (pvalue) { + PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p); + if (unlikely(!dictview)) goto bad; + *ppos = PyObject_GetIter(dictview); + Py_DECREF(dictview); + } else { + *ppos = PyObject_GetIter(p); + } + if (unlikely(!*ppos)) goto bad; + } + next = PyIter_Next(*ppos); + if (!next) { + if (PyErr_Occurred()) goto bad; + return 0; + } + if (pkey && pvalue) { + *pkey = __Pyx_PySequence_ITEM(next, 0); + if (unlikely(*pkey)) goto bad; + *pvalue = __Pyx_PySequence_ITEM(next, 1); + if (unlikely(*pvalue)) goto bad; + Py_DECREF(next); + } else if (pkey) { + *pkey = next; + } else { + assert(pvalue); + *pvalue = next; + } + return 1; + bad: + Py_XDECREF(next); +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 + PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef"); +#else + PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef); +#endif + if (pkey) *pkey = NULL; + if (pvalue) *pvalue = NULL; + return 0; +} +#else // !CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) { + int result = PyDict_Next(p, ppos, pkey, pvalue); + if (likely(result == 1)) { + if (pkey) Py_INCREF(*pkey); + if (pvalue) Py_INCREF(*pvalue); + } + return result; +} +#endif + +/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); +} + /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { @@ -47174,7 +49674,7 @@ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObje } } -/* ParseKeywords */ +/* ParseKeywordsImpl (used by ParseKeywords) */ static int __Pyx_ValidateDuplicatePosArgs( PyObject *kwds, PyObject ** const argnames[], @@ -47330,16 +49830,23 @@ static void __Pyx_RejectUnknownKeyword( PyObject ** const *first_kw_arg, const char *function_name) { + #if CYTHON_AVOID_BORROWED_REFS + PyObject *pos = NULL; + #else Py_ssize_t pos = 0; + #endif PyObject *key = NULL; __Pyx_BEGIN_CRITICAL_SECTION(kwds); - while (PyDict_Next(kwds, &pos, &key, NULL)) { + while ( + #if CYTHON_AVOID_BORROWED_REFS + __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL) + #else + PyDict_Next(kwds, &pos, &key, NULL) + #endif + ) { PyObject** const *name = first_kw_arg; while (*name && (**name != key)) name++; if (!*name) { - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); - #endif size_t index_found = 0; int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); if (cmp != 1) { @@ -47353,12 +49860,15 @@ static void __Pyx_RejectUnknownKeyword( #endif break; } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(key); - #endif } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif } __Pyx_END_CRITICAL_SECTION(); + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(pos); + #endif assert(PyErr_Occurred()); } static int __Pyx_ParseKeywordDict( @@ -47530,6 +50040,8 @@ static int __Pyx_ParseKeywordsTuple( #endif return -1; } + +/* ParseKeywords */ static int __Pyx_ParseKeywords( PyObject *kwds, PyObject * const *kwvalues, @@ -47575,7 +50087,7 @@ static void __Pyx_RaiseArgtupleInvalid( (num_expected == 1) ? "" : "s", num_found); } -/* ArgTypeTest */ +/* ArgTypeTestFunc (used by ArgTypeTest) */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; @@ -47631,70 +50143,110 @@ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { Py_DECREF(j); return r; } +static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) { + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); +} static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + int wraparound, int boundscheck, int unsafe_shared) { + CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); +#if CYTHON_AVOID_BORROWED_REFS + CYTHON_UNUSED_VAR(boundscheck); Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); + Py_ssize_t size = __Pyx_PyList_GET_SIZE(o); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) return NULL; + #endif + wrapped_i += size; } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; + return __Pyx_PyList_GetItemRef(o, wrapped_i); +#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t wrapped_i = i; + Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1; + if (wraparound & unlikely(i < 0)) { + wrapped_i += size; } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) { + return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared); + } + return __Pyx_GetItemInt_Generic_size(o, i); #else + (void)wraparound; + (void)boundscheck; return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS + int wraparound, int boundscheck, int unsafe_shared) { + CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); +#if CYTHON_AVOID_BORROWED_REFS + CYTHON_UNUSED_VAR(boundscheck); Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) return NULL; + #endif + wrapped_i += size; } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API + return PySequence_ITEM(o, wrapped_i); + #else + if (unlikely(wrapped_i < 0)) { + PyErr_SetString(PyExc_IndexError, "tuple index out of range"); + return NULL; } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + return PySequence_GetItem(o, wrapped_i); + #endif +#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t wrapped_i = i; + Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1; + if (wraparound & unlikely(i < 0)) { + wrapped_i += size; + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) { + return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i)); + } + return __Pyx_GetItemInt_Generic_size(o, i); #else + (void)wraparound; + (void)boundscheck; return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + int wraparound, int boundscheck, int unsafe_shared) { + CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - return __Pyx_PyList_GetItemRef(o, n); - } - } - else if (PyTuple_CheckExact(o)) { + return boundscheck ? __Pyx_PyList_GetItemRef(o, n) : __Pyx_PyList_GET_ITEM_REF(o, n, unsafe_shared); + } else + #if !CYTHON_AVOID_BORROWED_REFS + if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; + return __Pyx_NewRef(PyTuple_GET_ITEM(o, n)); } - } else { + } else + #endif +#else + if ((!wraparound || i >= 0) & PyList_CheckExact(o)) { + return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared); + } else +#endif +#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY + { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_subscript) { + if (!is_list && mm && mm->mp_subscript) { PyObject *r, *key = PyLong_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } - if (likely(sm && sm->sq_item)) { + if (is_list || likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { @@ -47713,7 +50265,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return PySequence_GetItem(o, i); } #endif - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + (void)wraparound; + (void)boundscheck; + return __Pyx_GetItemInt_Generic_size(o, i); } /* DictGetItem */ @@ -47810,7 +50364,7 @@ static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const * } #endif -/* PyObjectCall2Args */ +/* PyObjectCall2Args (used by CallUnboundCMethod1) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); @@ -47889,98 +50443,68 @@ static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; - long a, x; -#ifdef HAVE_LONG_LONG + long a; const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; -#endif + PY_LONG_LONG lla; if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } - if (likely(__Pyx_PyLong_IsCompact(op1))) { - a = __Pyx_PyLong_CompactValue(op1); + const int is_positive = __Pyx_PyLong_IsPos(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + if (likely(size == 1)) { + a = (long) digits[0]; + if (!is_positive) a *= -1; } else { - const digit* digits = __Pyx_PyLong_Digits(op1); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - 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])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; + break; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { 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])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - 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])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; + break; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { 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])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + break; } + return PyLong_Type.tp_as_number->nb_add(op1, op2); } + calculate_long: + { + long x; x = a + b; - return PyLong_FromLong(x); -#ifdef HAVE_LONG_LONG - long_long: + return PyLong_FromLong(x); + } + calculate_long_long: + { + PY_LONG_LONG llx; llx = lla + llb; - return PyLong_FromLongLong(llx); -#endif - return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); - + return PyLong_FromLongLong(llx); + } } #endif @@ -48207,7 +50731,7 @@ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObjec return value; } -/* IterFinish */ +/* IterFinish (used by dict_iter) */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare @@ -48222,19 +50746,14 @@ static CYTHON_INLINE int __Pyx_IterFinish(void) { return 0; } -/* PyObjectCallNoArg */ +/* PyObjectCallNoArg (used by PyObjectCallMethod0) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* PyObjectGetMethod */ +/* PyObjectGetMethod (used by PyObjectCallMethod0) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP @@ -48323,9 +50842,16 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me *method = attr; return 0; } +#endif -/* PyObjectCallMethod0 */ +/* PyObjectCallMethod0 (used by dict_iter) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { +#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) + PyObject *args[1] = {obj}; + (void) __Pyx_PyObject_CallOneArg; + (void) __Pyx_PyObject_CallNoArg; + return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#else PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { @@ -48338,22 +50864,23 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name Py_DECREF(method); bad: return result; +#endif } -/* RaiseNeedMoreValuesToUnpack */ +/* RaiseNeedMoreValuesToUnpack (used by UnpackTuple2) */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } -/* RaiseTooManyValuesToUnpack */ +/* RaiseTooManyValuesToUnpack (used by UnpackItemEndCheck) */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } -/* UnpackItemEndCheck */ +/* UnpackItemEndCheck (used by UnpackTuple2) */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); @@ -48363,12 +50890,12 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { return __Pyx_IterFinish(); } -/* RaiseNoneIterError */ +/* RaiseNoneIterError (used by UnpackTupleError) */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } -/* UnpackTupleError */ +/* UnpackTupleError (used by UnpackTuple2) */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); @@ -48385,7 +50912,7 @@ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { } } -/* UnpackTuple2 */ +/* UnpackTuple2 (used by dict_iter) */ static CYTHON_INLINE int __Pyx_unpack_tuple2( PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) { if (likely(is_tuple || PyTuple_Check(tuple))) { @@ -48457,7 +50984,7 @@ static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyOb } /* dict_iter */ -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_AVOID_BORROWED_REFS #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, @@ -48465,7 +50992,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; @@ -48494,7 +51021,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif @@ -48504,7 +51031,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di } return PyObject_GetIter(iterable); } -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem) { @@ -48555,7 +51082,7 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS if (source_is_dict) { int result; #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API @@ -48589,17 +51116,8 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( #endif if (unlikely(pos >= list_size)) return 0; *ppos = pos + 1; - #if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - next_item = PyList_GetItemRef(iter_obj, pos); + next_item = __Pyx_PyList_GET_ITEM_REF(iter_obj, pos, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!next_item)) return -1; - #elif CYTHON_ASSUME_SAFE_MACROS - next_item = PyList_GET_ITEM(iter_obj, pos); - Py_INCREF(next_item); - #else - next_item = PyList_GetItem(iter_obj, pos); - if (unlikely(!next_item)) return -1; - Py_INCREF(next_item); - #endif } else #endif { @@ -48621,7 +51139,7 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( return 1; } -/* PyDictVersioning */ +/* PyDictVersioning (used by GetModuleGlobalName) */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; @@ -48683,12 +51201,67 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) return __Pyx_GetBuiltinName(name); } +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { + PyObject *runerr = NULL; + Py_ssize_t key_value; + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index)); + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, + "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); + __Pyx_DECREF_TypeName(index_type_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { + __Pyx_TypeName obj_type_name; + if (likely(PyType_Check(obj))) { + #if __PYX_LIMITED_VERSION_HEX >= 0x03090000 + if ((PyTypeObject*)obj == &PyType_Type) { + return Py_GenericAlias(obj, key); + } + #endif + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem); + if (!meth) { + PyErr_Clear(); + } else { + PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); + Py_DECREF(meth); + return result; + } + } + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { + PyTypeObject *tp = Py_TYPE(obj); + PyMappingMethods *mm = tp->tp_as_mapping; + PySequenceMethods *sm = tp->tp_as_sequence; + if (likely(mm && mm->mp_subscript)) { + return mm->mp_subscript(obj, key); + } + if (likely(sm && sm->sq_item)) { + return __Pyx_PyObject_GetIndex(obj, key); + } + return __Pyx_PyObject_GetItem_Slow(obj, key); +} +#endif + /* RaiseUnboundLocalError */ static void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } -/* GetException */ +/* GetException (used by pep479) */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else @@ -48709,12 +51282,12 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif -#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000 +#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000 local_value = PyErr_GetRaisedException(); #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif -#if __PYX_LIMITED_VERSION_HEX > 0x030C0000 +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); @@ -48732,7 +51305,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } -#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000 +#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000 Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); @@ -48779,7 +51352,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; -#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000 +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 bad: *type = 0; *value = 0; @@ -48819,6 +51392,7 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { } PyException_SetCause(new_exc, val); // steals ref to val PyErr_SetObject(PyExc_RuntimeError, new_exc); + Py_DECREF(new_exc); } /* PyLongCompare */ @@ -48887,58 +51461,8 @@ static void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } -/* ObjectGetItem */ -#if CYTHON_USE_TYPE_SLOTS -static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { - PyObject *runerr = NULL; - Py_ssize_t key_value; - key_value = __Pyx_PyIndex_AsSsize_t(index); - if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { - return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); - } - if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { - __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index)); - PyErr_Clear(); - PyErr_Format(PyExc_IndexError, - "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); - __Pyx_DECREF_TypeName(index_type_name); - } - return NULL; -} -static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { - __Pyx_TypeName obj_type_name; - if (likely(PyType_Check(obj))) { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem); - if (!meth) { - PyErr_Clear(); - } else { - PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); - Py_DECREF(meth); - return result; - } - } - obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return NULL; -} -static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { - PyTypeObject *tp = Py_TYPE(obj); - PyMappingMethods *mm = tp->tp_as_mapping; - PySequenceMethods *sm = tp->tp_as_sequence; - if (likely(mm && mm->mp_subscript)) { - return mm->mp_subscript(obj, key); - } - if (likely(sm && sm->sq_item)) { - return __Pyx_PyObject_GetIndex(obj, key); - } - return __Pyx_PyObject_GetItem_Slow(obj, key); -} -#endif - -/* PyObjectCallMethod1 */ -#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) +/* PyObjectCallMethod1 (used by append) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); @@ -48946,9 +51470,8 @@ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { -#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 +#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) PyObject *args[2] = {obj, arg}; - (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); @@ -49039,12 +51562,12 @@ static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, l PyObject_RichCompare(op1, op2, Py_NE)); } -/* PyObjectVectorCallKwBuilder */ +/* PyObjectVectorCallKwBuilder (used by PyObjectVectorCallMethodKwBuilder) */ #if CYTHON_VECTORCALL static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { (void)__Pyx_PyObject_FastCallDict; - if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; Py_INCREF(key); + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; args[n] = value; return 0; } @@ -49084,6 +51607,28 @@ static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, P } #endif +/* AllocateExtensionType */ +static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) { + if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc); + return alloc_func(t, 0); + } else { + newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc); + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (!tp_new) { + PyObject *new_str = PyUnicode_FromString("__new__"); + if (likely(new_str)) { + PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL); + Py_DECREF(new_str); + return o; + } else + return NULL; + } else + #endif + return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0); + } +} + /* CallTypeTraverse */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else @@ -49103,7 +51648,7 @@ static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visi } #endif -/* LimitedApiGetTypeDict */ +/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static Py_ssize_t __Pyx_GetTypeDictOffset(void) { PyObject *tp_dictoffset_o; @@ -49139,7 +51684,7 @@ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { } #endif -/* SetItemOnTypeDict */ +/* SetItemOnTypeDict (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { int result; PyObject *tp_dict; @@ -49196,14 +51741,11 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); -#if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; -#else - type->tp_print = (printfunc) memb->offset; -#endif changed = 1; } #endif // CYTHON_METH_FASTCALL +#if !CYTHON_COMPILING_IN_PYPY else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); @@ -49218,11 +51760,13 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject } changed = 1; } +#endif // !CYTHON_COMPILING_IN_PYPY } memb++; } } #endif // !CYTHON_COMPILING_IN_LIMITED_API +#if !CYTHON_COMPILING_IN_PYPY slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_getset) slot++; @@ -49254,13 +51798,16 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject ++getset; } } +#else + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); +#endif // !CYTHON_COMPILING_IN_PYPY if (changed) PyType_Modified(type); #endif // PY_VERSION_HEX > 0x030900B1 return 0; } -/* ValidateBasesTuple */ +/* ValidateBasesTuple (used by PyType_Ready) */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; @@ -49430,38 +51977,121 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #endif } -/* ListPack */ -static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { - va_list va; - PyObject *l = PyList_New(n); - va_start(va, n); - if (unlikely(!l)) goto end; - for (Py_ssize_t i=0; i__pyx_d, empty_dict, from_list, 1); + name, moddict, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; @@ -49472,14 +52102,19 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { } if (!module) { module = PyImport_ImportModuleLevelObject( - name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); + name, moddict, empty_dict, from_list, level); } bad: + Py_XDECREF(from_list); Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); return module; } +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) { + return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level); +} + /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); @@ -49519,20 +52154,16 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { return value; } -/* FetchSharedCythonModule */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); -} - -/* dict_setdefault */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, - int is_safe_type) { +/* dict_setdefault (used by FetchCommonType) */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) { PyObject* value; - CYTHON_MAYBE_UNUSED_VAR(is_safe_type); -#if CYTHON_COMPILING_IN_LIMITED_API - value = PyObject_CallMethod(d, "setdefault", "OO", key, default_value); -#elif PY_VERSION_HEX >= 0x030d0000 +#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4) PyDict_SetDefaultRef(d, key, default_value, &value); +#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + PyObject *args[] = {d, key, default_value}; + value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#elif CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL); #else value = PyDict_SetDefault(d, key, default_value); if (unlikely(!value)) return NULL; @@ -49541,7 +52172,57 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke return value; } -/* FetchCommonType */ +/* AddModuleRef (used by FetchSharedCythonModule) */ +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) { + PyObject *module_dict = PyImport_GetModuleDict(); + PyObject *m; + if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) { + return NULL; + } + if (m != NULL && PyModule_Check(m)) { + return m; + } + Py_XDECREF(m); + m = PyModule_NewObject(name); + if (m == NULL) + return NULL; + if (PyDict_CheckExact(module_dict)) { + PyObject *new_m; + (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m); + Py_DECREF(m); + return new_m; + } else { + if (PyObject_SetItem(module_dict, name, m) != 0) { + Py_DECREF(m); + return NULL; + } + return m; + } + } + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *py_name = PyUnicode_FromString(name); + if (!py_name) return NULL; + PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name); + Py_DECREF(py_name); + return module; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif + +/* FetchSharedCythonModule (used by FetchCommonType) */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); +} + +/* FetchCommonType (used by CommonTypesMetaclass) */ #if __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases); @@ -49614,11 +52295,13 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyOb } else if (unlikely(get_item_ref_result == -1)) { goto bad; } - CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromMetaclass(metaclass, abi_module, spec, bases); + cached_type = __Pyx_PyType_FromMetaclass( + metaclass, + CYTHON_USE_MODULE_STATE ? module : abi_module, + spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; - new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1); + new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type); if (unlikely(new_cached_type != cached_type)) { if (unlikely(!new_cached_type)) goto bad; Py_DECREF(cached_type); @@ -49644,26 +52327,39 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyOb goto done; } -/* CommonTypesMetaclass */ -PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { +/* CommonTypesMetaclass (used by CythonFunctionShared) */ +static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); } +#if __PYX_LIMITED_VERSION_HEX < 0x030A0000 +static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) { + PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types"); + return NULL; +} +static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) { + PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable"); + return -1; +} +#endif static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = { {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL}, {0, 0, 0, 0, 0} }; static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = { {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset}, + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call}, + {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call}, + {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr}, + #endif {0, 0} }; static PyType_Spec __pyx_CommonTypesMetaclass_spec = { __PYX_TYPE_MODULE_PREFIX "_common_types_metatype", 0, 0, -#if PY_VERSION_HEX >= 0x030A0000 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | -#endif Py_TPFLAGS_DEFAULT, __pyx_CommonTypesMetaclass_slots }; @@ -49674,13 +52370,14 @@ static int __pyx_CommonTypesMetaclass_init(PyObject *module) { return -1; } mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); + Py_DECREF(bases); if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { return -1; } return 0; } -/* PyMethodNew */ +/* PyMethodNew (used by CythonFunctionShared) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *result; @@ -49706,15 +52403,20 @@ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *ty } #endif -/* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +/* PyVectorcallFastCallDict (used by CythonFunctionShared) */ +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; - Py_ssize_t i, pos; + Py_ssize_t i; + #if CYTHON_AVOID_BORROWED_REFS + PyObject *pos; + #else + Py_ssize_t pos; + #endif size_t j; PyObject *key, *value; unsigned long keys_are_strings; @@ -49736,17 +52438,16 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector return NULL; } kwvalues = newargs + nargs; - pos = i = 0; + pos = 0; + i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; - while (PyDict_Next(kw, &pos, &key, &value)) { + while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) { keys_are_strings &= #if CYTHON_COMPILING_IN_LIMITED_API PyType_GetFlags(Py_TYPE(key)); #else Py_TYPE(key)->tp_flags; #endif - Py_INCREF(key); - Py_INCREF(value); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; #else @@ -49761,6 +52462,9 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } res = vc(func, newargs, nargs, kwnames); cleanup: + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(pos); + #endif Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); @@ -49789,7 +52493,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ } #endif -/* CythonFunctionShared */ +/* CythonFunctionShared (used by CythonFunction) */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { if (__Pyx_CyFunction_Check(func)) { @@ -49941,9 +52645,11 @@ __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void __Pyx_END_CRITICAL_SECTION(); return 0; } +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject * -__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) @@ -49952,36 +52658,7 @@ __Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) Py_INCREF(op->func_dict); return op->func_dict; } -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - PyObject *result; - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_dict_locked(op); - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - Py_INCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->func_dict, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; -} +#endif static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { @@ -50109,6 +52786,7 @@ __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { __Pyx_END_CRITICAL_SECTION(); return result; } +static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value); static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -50123,8 +52801,54 @@ __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, vo __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_annotations, value); __Pyx_END_CRITICAL_SECTION(); + if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists((PyObject*) op, Py_None) < 0)) return -1; return 0; } +static int +__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) { + /* Return 1 if the function dict exists, 0 otherwise. This cannot fail: + * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */ +#if CYTHON_COMPILING_IN_PYPY + *dict = PyObject_GenericGetDict(op_in, NULL); +#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000 + *dict = ((__pyx_CyFunctionObject*) op_in)->func_dict; +#else + PyObject **dictptr = _PyObject_GetDictPtr(op_in); + *dict = likely(dictptr) ? *dictptr : NULL; +#endif + return *dict ? 1 : 0; +} +static int +__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) { + PyObject *dict; + int dict_found; + *annotate = NULL; + dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict); + if (!dict_found) return 0; + return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate); +} +static int +__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) { + PyObject *dict; + int dict_found; + dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict); + if (!dict_found) return 0; + return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value); +} +static int +__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) { + PyObject *dict; + int result; +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + dict = __Pyx_CyFunction_get_dict((__pyx_CyFunctionObject*) op_in, NULL); +#else + dict = PyObject_GenericGetDict(op_in, NULL); +#endif + if (unlikely(!dict)) return -1; + result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value); + Py_DECREF(dict); + return result; +} static PyObject * __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; @@ -50137,14 +52861,88 @@ __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { return result; } static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { - PyObject *result; +__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) { + PyObject *annotate = NULL; + PyObject *result = NULL; + __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in; CYTHON_UNUSED_VAR(context); - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + result = __Pyx_XNewRef(op->func_annotations); + __Pyx_END_CRITICAL_SECTION(); + if (result) return result; + if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL; + if (!annotate || annotate == Py_None) { + Py_XDECREF(annotate); + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; + } + PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE + if (likely(format)) { + result = __Pyx_PyObject_CallOneArg(annotate, format); + Py_DECREF(format); + } + Py_DECREF(annotate); + if (unlikely(!result)) return NULL; + if (unlikely(!PyDict_Check(result))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict"); + Py_DECREF(result); + return NULL; + } + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result)); __Pyx_END_CRITICAL_SECTION(); return result; } +static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *args) { + CYTHON_UNUSED_VAR(args); + if (unlikely(!self)) { + PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument"); + } + Py_XINCREF(self); + return self; +} +static PyMethodDef __Pyx_CyFunction_annotate_method = { + "__annotate__", + (PyCFunction)(void (*)(void))__Pyx_CyFunction_annotate_impl, + METH_VARARGS, + "Placeholder __annotate__ function to allow 'functools.wraps' to work " + "on Cython functions." +}; +static PyObject * +__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) { + PyObject *annotate = NULL; + CYTHON_UNUSED_VAR(context); + if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL; + if (annotate) return annotate; + PyObject *annotations = __Pyx_CyFunction_get_annotations(op_in, NULL); + if (unlikely(!annotations)) return NULL; + PyObject *method = PyCFunction_New( + &__Pyx_CyFunction_annotate_method, + annotations); + Py_DECREF(annotations); + return method; +} +static int +__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted"); + return -1; + } + if (unlikely(value != Py_None && !PyCallable_Check(value))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None"); + return -1; + } + if (value != Py_None) { + __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in; + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + Py_CLEAR(op->func_annotations); + __Pyx_END_CRITICAL_SECTION(); + } + return __Pyx_CyFunction_set_annotate_in_dict(op_in, value); +} static PyObject * __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; @@ -50157,7 +52955,6 @@ __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { - Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } @@ -50243,8 +53040,13 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, + {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, +#else + {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, + {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, +#endif {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, @@ -50255,6 +53057,7 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0}, {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, @@ -50265,9 +53068,11 @@ static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#endif #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, @@ -50323,7 +53128,9 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_XINCREF(module); cf->m_module = module; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API op->func_dict = NULL; +#endif op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; @@ -50377,14 +53184,19 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func_dict); +#elif PY_VERSION_HEX < 0x030d0000 + _PyObject_ClearManagedDict((PyObject*)m); +#else + PyObject_ClearManagedDict((PyObject*)m); +#endif Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { @@ -50392,7 +53204,6 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } -#endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); @@ -50425,17 +53236,29 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func_dict); +#else + { + int e = +#if PY_VERSION_HEX < 0x030d0000 + _PyObject_VisitManagedDict +#else + PyObject_VisitManagedDict +#endif + ((PyObject*)m, visit, arg); + if (e != 0) return e; + } +#endif __Pyx_VISIT_CONST(m->func_name); __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); __Pyx_VISIT_CONST(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); -#endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_annotations); Py_VISIT(m->func_is_coroutine); Py_VISIT(m->defaults); return 0; @@ -50537,7 +53360,7 @@ static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *a static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE @@ -50576,7 +53399,7 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; @@ -50598,11 +53421,7 @@ static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionO static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -50637,11 +53456,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -50676,11 +53491,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -50711,11 +53522,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -50740,7 +53547,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); + #if PY_VERSION_HEX < 0x030e00A6 + size_t nargs_value = (size_t) nargs; + #else + Py_ssize_t nargs_value = nargs; + #endif + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames); } #endif static PyType_Slot __pyx_CyFunctionType_slots[] = { @@ -50769,9 +53581,10 @@ static PyType_Spec __pyx_CyFunctionType_spec = { _Py_TPFLAGS_HAVE_VECTORCALL | #endif #endif // CYTHON_METH_FASTCALL -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | +#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_TPFLAGS_MANAGED_DICT | #endif + Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; @@ -50820,7 +53633,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual return op; } -/* CalculateMetaclass */ +/* CalculateMetaclass (used by Py3ClassCreate) */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_SIZE @@ -50862,7 +53675,7 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas return (PyObject*) metaclass; } -/* PyObjectLookupSpecial */ +/* PyObjectLookupSpecial (used by Py3ClassCreate) */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; @@ -51041,55 +53854,44 @@ __Pyx_PEP560_update_bases(PyObject *bases) return NULL; } -/* CLineInTraceback */ +/* CLineInTraceback (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o)) +#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL); +#else +PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) { + PyObject **dict_ptr = _PyObject_GetDictPtr(o); + return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL; +} +#endif static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { - PyObject *use_cline; + PyObject *use_cline = NULL; PyObject *ptype, *pvalue, *ptraceback; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject **cython_runtime_dict; -#endif + PyObject *cython_runtime_dict; CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); -#if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); + cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { - __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict); __PYX_PY_DICT_LOOKUP_IF_MODIFIED( - use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) - Py_XINCREF(use_cline); - __Pyx_END_CRITICAL_SECTION(); - } else -#endif - { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); - if (use_cline_obj) { - use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; - Py_INCREF(use_cline); - Py_DECREF(use_cline_obj); - } else { - PyErr_Clear(); - use_cline = NULL; - } + use_cline, cython_runtime_dict, + __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False)) } - if (!use_cline) { - c_line = 0; - (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); - } - else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } Py_XDECREF(use_cline); + Py_XDECREF(cython_runtime_dict); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif -/* CodeObjectCache */ +/* CodeObjectCache (used by AddTraceback) */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -51241,8 +54043,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { - (void) __pyx_cfilenm; - (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = __pyx_find_code_object(c_line ? -c_line : py_line); @@ -51251,7 +54052,11 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); + if (c_line) { + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + } else { + py_funcname = PyUnicode_FromString(funcname); + } if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; @@ -51359,7 +54164,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif @@ -51367,10 +54172,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { } else { if (sizeof(long) <= sizeof(long)) { return PyLong_FromLong((long) value); -#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif } } { @@ -51453,7 +54256,7 @@ __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) } #endif -/* CIntFromPyVerify */ +/* CIntFromPyVerify (used by CIntFromPy) */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ @@ -51549,10 +54352,8 @@ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -51621,10 +54422,8 @@ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif } } { @@ -51803,10 +54602,8 @@ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -51875,10 +54672,8 @@ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif } } { @@ -52070,7 +54865,40 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj } #endif -/* GetTopmostException */ +/* GetRuntimeVersion */ +#if __PYX_LIMITED_VERSION_HEX < 0x030b0000 +void __Pyx_init_runtime_version(void) { + if (__Pyx_cached_runtime_version == 0) { + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + __Pyx_cached_runtime_version = version; + } +} +#endif +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + return Py_Version & ~0xFFUL; +#else + return __Pyx_cached_runtime_version; +#endif +} + +/* GetTopmostException (used by SaveResetException) */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) @@ -52085,7 +54913,7 @@ __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) } #endif -/* SaveResetException */ +/* SaveResetException (used by CoroutineBase) */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 @@ -52152,7 +54980,7 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject } #endif -/* SwapException */ +/* SwapException (used by CoroutineBase) */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; @@ -52206,7 +55034,7 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, } #endif -/* IterNextPlain */ +/* IterNextPlain (used by CoroutineBase) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) { if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache)) @@ -52229,7 +55057,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { #endif } -/* ReturnWithStopIteration */ +/* ReturnWithStopIteration (used by CoroutineBase) */ static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) { if (value == Py_None) { @@ -52283,7 +55111,7 @@ static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { Py_DECREF(exc); } -/* CoroutineBase */ +/* CoroutineBase (used by Generator) */ #if !CYTHON_COMPILING_IN_LIMITED_API #include #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) @@ -52894,7 +55722,8 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject ret = __Pyx_PyObject_Call(meth, args, NULL); } else { PyObject *cargs[4] = {NULL, typ, val, tb}; - ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + size_t nargs = 1U + (val != NULL) + (tb != NULL); + ret = __Pyx_PyObject_FastCall(meth, cargs+1, nargs | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } Py_DECREF(meth); } @@ -52966,7 +55795,9 @@ static int __Pyx_Coroutine_clear(PyObject *self) { static void __Pyx_Coroutine_dealloc(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject_GC_UnTrack(gen); + #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API if (gen->gi_weakreflist != NULL) + #endif PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); @@ -53089,14 +55920,10 @@ __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void __Pyx_Py_XDECREF_SET(self->gi_qualname, value); return 0; } -static PyObject * -__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) -{ #if !CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx__Coroutine_get_frame_locked(__pyx_CoroutineObject *self) { PyObject *frame; - #if PY_VERSION_HEX >= 0x030d0000 - Py_BEGIN_CRITICAL_SECTION(self); - #endif frame = self->gi_frame; if (!frame) { if (unlikely(!self->gi_code)) { @@ -53121,9 +55948,17 @@ __Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) } } Py_INCREF(frame); - #if PY_VERSION_HEX >= 0x030d0000 - Py_END_CRITICAL_SECTION(); - #endif + return frame; +} +#endif +static PyObject * +__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) +{ +#if !CYTHON_COMPILING_IN_LIMITED_API + PyObject *frame; + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)self); + frame = __Pyx__Coroutine_get_frame_locked(self); + __Pyx_END_CRITICAL_SECTION(); return frame; #else CYTHON_UNUSED_VAR(self); @@ -53167,7 +56002,9 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( #if CYTHON_USE_EXC_INFO_STACK gen->gi_exc_state.previous_item = NULL; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API gen->gi_weakreflist = NULL; +#endif Py_XINCREF(qualname); gen->gi_qualname = qualname; Py_XINCREF(name); @@ -53177,40 +56014,32 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( Py_XINCREF(code); gen->gi_code = code; gen->gi_frame = NULL; +#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) + memset(gen->__pyx_pymonitoring_state, 0, sizeof(gen->__pyx_pymonitoring_state)); + gen->__pyx_pymonitoring_version = 0; +#endif PyObject_GC_Track(gen); return gen; } static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) { char result; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen); result = gen->is_running; gen->is_running = 1; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif + __Pyx_END_CRITICAL_SECTION(); return result; } static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) { - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen); assert(gen->is_running); gen->is_running = 0; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif + __Pyx_END_CRITICAL_SECTION(); } static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) { char result; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen); result = gen->is_running; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif + __Pyx_END_CRITICAL_SECTION(); return result; } static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) { @@ -53256,7 +56085,9 @@ static PyMemberDef __pyx_Generator_memberlist[] = { PyDoc_STR("object being iterated by 'yield from', or None")}, {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, +#endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { @@ -53290,10 +56121,11 @@ static PyType_Spec __pyx_GeneratorType_spec = { __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | +#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_TPFLAGS_MANAGED_WEAKREF | #endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, + Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND, __pyx_GeneratorType_slots }; #if __PYX_HAS_PY_AM_SEND == 2 @@ -53325,36 +56157,6 @@ static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { return retval; } -/* GetRuntimeVersion */ -static unsigned long __Pyx_get_runtime_version(void) { -#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 - return Py_Version & ~0xFFUL; -#else - static unsigned long __Pyx_cached_runtime_version = 0; - if (__Pyx_cached_runtime_version == 0) { - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); - ++i; - } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; - } - __Pyx_cached_runtime_version = version; - } - return __Pyx_cached_runtime_version; -#endif -} - /* CheckBinaryVersion */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; @@ -53438,9 +56240,13 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1 + if (likely(result)) + result->_co_firsttraceable = 0; + #endif return result; } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY +#elif !CYTHON_COMPILING_IN_PYPY #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else @@ -53452,10 +56258,10 @@ static PyObject* __Pyx_PyCode_New( PyObject * const *varnames, PyObject *filename, PyObject *funcname, - const char *line_table, + PyObject *line_table, PyObject *tuple_dedup_map ) { - PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL; + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL; Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; PyObject *varnames_tuple = PyTuple_New(var_count); if (unlikely(!varnames_tuple)) return NULL; @@ -53476,11 +56282,12 @@ static PyObject* __Pyx_PyCode_New( #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(varnames_tuple_dedup); #endif - if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL - && !CYTHON_COMPILING_IN_GRAAL) { - line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length); - if (unlikely(!line_table_bytes)) goto done; - Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3; + if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) { + Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(line_table_length == -1)) goto done; + #endif + Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL; code_bytes = PyBytes_FromStringAndSize(NULL, code_len); if (unlikely(!code_bytes)) goto done; char* c_code_bytes = PyBytes_AsString(code_bytes); @@ -53503,11 +56310,10 @@ static PyObject* __Pyx_PyCode_New( filename, funcname, (int) descr.first_line, - (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes ); done: Py_XDECREF(code_bytes); - Py_XDECREF(line_table_bytes); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(varnames_tuple_dedup); #endif @@ -53515,30 +56321,68 @@ static PyObject* __Pyx_PyCode_New( return code_obj; } -/* InitStrings */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { - while (t->s) { - PyObject *str; - if (t->is_unicode) { - if (t->intern) { - str = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); - } else { - str = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - str = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - if (!str) - return -1; - *target = str; - if (PyObject_Hash(str) == -1) - return -1; - ++t; - ++target; +/* DecompressString */ +static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) { + PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed; + const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib"; + PyObject *methodname = PyUnicode_FromString("decompress"); + if (unlikely(!methodname)) return NULL; + #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000 + if (algo == 3) { + PyObject *fromlist = Py_BuildValue("[O]", methodname); + if (unlikely(!fromlist)) goto bad; + module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + } else + #endif + module = PyImport_ImportModule(module_name); + if (unlikely(!module)) goto import_failed; + decompress = PyObject_GetAttr(module, methodname); + if (unlikely(!decompress)) goto import_failed; + { + #ifdef __cplusplus + char *memview_bytes = const_cast(s); + #else + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wcast-qual" + #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-qual" + #endif + char *memview_bytes = (char*) s; + #if defined(__clang__) + #pragma clang diagnostic pop + #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) + #pragma GCC diagnostic pop + #endif + #endif + #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ) + int memview_flags = 0x100; + #else + int memview_flags = PyBUF_READ; + #endif + compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags); } - return 0; + if (unlikely(!compressed_bytes)) { + Py_DECREF(decompress); + goto bad; + } + decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL); + Py_DECREF(compressed_bytes); + Py_DECREF(decompress); + Py_DECREF(module); + Py_DECREF(methodname); + return decompressed; +import_failed: + PyErr_Format(PyExc_ImportError, + "Failed to import '%.20s.decompress' - cannot initialise module strings. " + "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.", + module_name, algo); +bad: + Py_XDECREF(module); + Py_DECREF(methodname); + return NULL; } #include @@ -53760,7 +56604,7 @@ static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { return __Pyx_NewRef(Py_None); } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { - return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); + return __Pyx_NewRef(b ? Py_True: Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { return PyLong_FromSize_t(ival); diff --git a/constraint/constraints.py b/constraint/constraints.py index c5038b9..f392237 100644 --- a/constraint/constraints.py +++ b/constraint/constraints.py @@ -1,10 +1,11 @@ """Module containing the code for constraint definitions.""" -from constraint.domain import Unassigned -from typing import Callable, Union, Optional -from collections.abc import Sequence +from collections.abc import Callable, Sequence from itertools import product +from constraint.domain import Unassigned + + class Constraint: """Abstract base class for constraints.""" @@ -121,6 +122,13 @@ class FunctionConstraint(Constraint): >>> problem.addConstraint(FunctionConstraint(func), ["a", "b"]) >>> problem.getSolution() {'a': 1, 'b': 2} + >>> problem = Problem() + >>> problem.addVariables([1, 2], ["a", "b"]) + >>> def func(x, y): + ... return x != y + >>> problem.addConstraint(FunctionConstraint(func), [1, 2]) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[(1, 'a'), (2, 'b')], [(1, 'b'), (2, 'a')]] """ def __init__(self, func: Callable, assigned: bool = True): @@ -284,9 +292,14 @@ class ExactSumConstraint(Constraint): >>> problem.addConstraint(ExactSumConstraint(3)) >>> sorted(sorted(x.items()) for x in problem.getSolutions()) [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)]] + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [-1, 0, 1]) + >>> problem.addConstraint(ExactSumConstraint(0)) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[('a', -1), ('b', 1)], [('a', 0), ('b', 0)], [('a', 1), ('b', -1)]] """ - def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): + def __init__(self, exactsum: int | float, multipliers: Sequence | None = None): """Initialization method. Args: @@ -297,40 +310,56 @@ def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] """ self._exactsum = exactsum self._multipliers = multipliers + self._var_max = {} + self._var_min = {} + self._var_is_negative = {} def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 Constraint.preProcess(self, variables, domains, constraints, vconstraints) - multipliers = self._multipliers + multipliers = self._multipliers if self._multipliers else [1] * len(variables) exactsum = self._exactsum - if multipliers: - for variable, multiplier in zip(variables, multipliers): - domain = domains[variable] - for value in domain[:]: - if value * multiplier > exactsum: - domain.remove(value) - else: - for variable in variables: - domain = domains[variable] - for value in domain[:]: - if value > exactsum: - domain.remove(value) + self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + + # preprocess the domains to remove values that cannot contribute to the exact sum + for variable, multiplier in zip(variables, multipliers): + domain = domains[variable] + other_vars_min = sum_other_vars(variables, variable, self._var_min) + other_vars_max = sum_other_vars(variables, variable, self._var_max) + for value in domain[:]: + if value * multiplier + other_vars_min > exactsum: + domain.remove(value) + if value * multiplier + other_vars_max < exactsum: + domain.remove(value) + # recalculate the min and max after pruning + self._var_max = { variable: max(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + self._var_min = { variable: min(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } + def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 multipliers = self._multipliers exactsum = self._exactsum sum = 0 + min_sum_missing = 0 + max_sum_missing = 0 missing = False + missing_negative = False if multipliers: for variable, multiplier in zip(variables, multipliers): if variable in assignments: sum += assignments[variable] * multiplier else: + min_sum_missing += self._var_min[variable] + max_sum_missing += self._var_max[variable] missing = True + if self._var_is_negative[variable]: + missing_negative = True if isinstance(sum, float): sum = round(sum, 10) - if sum > exactsum: + if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: return False - if forwardcheck and missing: + if forwardcheck and missing and not missing_negative: for variable, multiplier in zip(variables, multipliers): if variable not in assignments: domain = domains[variable] @@ -344,12 +373,16 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar if variable in assignments: sum += assignments[variable] else: + min_sum_missing += self._var_min[variable] + max_sum_missing += self._var_max[variable] missing = True + if self._var_is_negative[variable]: + missing_negative = True if isinstance(sum, float): sum = round(sum, 10) - if sum > exactsum: + if sum + min_sum_missing > exactsum or sum + max_sum_missing < exactsum: return False - if forwardcheck and missing: + if forwardcheck and missing and not missing_negative: for variable in variables: if variable not in assignments: domain = domains[variable] @@ -359,7 +392,7 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar if not domain: return False if missing: - return sum <= exactsum + return sum + min_sum_missing <= exactsum and sum + max_sum_missing >= exactsum else: return sum == exactsum @@ -372,9 +405,16 @@ class VariableExactSumConstraint(Constraint): >>> problem.addConstraint(VariableExactSumConstraint('c', ['a', 'b'])) >>> sorted(sorted(x.items()) for x in problem.getSolutions()) [[('a', 1), ('b', 1), ('c', 2)], [('a', 1), ('b', 2), ('c', 3)], [('a', 2), ('b', 1), ('c', 3)]] - """ + >>> problem = Problem() + >>> problem.addVariable('a', [-1,0,1]) + >>> problem.addVariable('b', [-1,0,1]) + >>> problem.addVariable('c', [0, 2]) + >>> problem.addConstraint(VariableExactSumConstraint('c', ['a', 'b'])) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[('a', -1), ('b', 1), ('c', 0)], [('a', 0), ('b', 0), ('c', 0)], [('a', 1), ('b', -1), ('c', 0)], [('a', 1), ('b', 1), ('c', 2)]] + """ # noqa: E501 - def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): + def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): """Initialization method. Args: @@ -456,9 +496,9 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar if temp_sum > target_value: domain.hideValue(value) else: + temp_sum = sum_value - min(domain) # sum_value already includes min for unassigned vars for value in domain[:]: - temp_sum = sum_value + value - if temp_sum > target_value: + if temp_sum + value > target_value: domain.hideValue(value) if not domain: return False @@ -476,9 +516,14 @@ class MinSumConstraint(Constraint): >>> problem.addConstraint(MinSumConstraint(3)) >>> sorted(sorted(x.items()) for x in problem.getSolutions()) [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)], [('a', 2), ('b', 2)]] + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [-3, 1]) + >>> problem.addConstraint(MinSumConstraint(-2)) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[('a', -3), ('b', 1)], [('a', 1), ('b', -3)], [('a', 1), ('b', 1)]] """ - def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): + def __init__(self, minsum: int | float, multipliers: Sequence | None = None): """Initialization method. Args: @@ -489,26 +534,50 @@ def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = """ self._minsum = minsum self._multipliers = multipliers + self._var_max = {} - def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - # check if each variable is in the assignments - for variable in variables: - if variable not in assignments: - return True + def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 + Constraint.preProcess(self, variables, domains, constraints, vconstraints) + multipliers = self._multipliers if self._multipliers else [1] * len(variables) + self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 - # with each variable assigned, sum the values + # preprocess the domains to remove values that cannot contribute to the minimum sum + for variable, multiplier in zip(variables, multipliers): + domain = domains[variable] + others_max = sum_other_vars(variables, variable, self._var_max) + for value in domain[:]: + if value * multiplier + others_max < self._minsum: + domain.remove(value) + + # recalculate the max after pruning + self._var_max = { variable: max(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + + def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 multipliers = self._multipliers minsum = self._minsum sum = 0 + missing = False + max_sum_missing = 0 if multipliers: for variable, multiplier in zip(variables, multipliers): - sum += assignments[variable] * multiplier + if variable in assignments: + sum += assignments[variable] * multiplier + else: + max_sum_missing += self._var_max[variable] + missing = True else: for variable in variables: - sum += assignments[variable] + if variable in assignments: + sum += assignments[variable] + else: + max_sum_missing += self._var_max[variable] + missing = True + if isinstance(sum, float): sum = round(sum, 10) - return sum >= minsum + if sum + max_sum_missing < minsum: + return False + return sum >= minsum or missing class VariableMinSumConstraint(Constraint): """Constraint enforcing that the sum of variables sum at least to the value of another variable. @@ -519,9 +588,15 @@ class VariableMinSumConstraint(Constraint): >>> problem.addConstraint(VariableMinSumConstraint('c', ['a', 'b'])) >>> sorted(sorted(x.items()) for x in problem.getSolutions()) [[('a', 1), ('b', 1), ('c', 1)], [('a', 1), ('b', 4), ('c', 1)], [('a', 1), ('b', 4), ('c', 4)], [('a', 4), ('b', 1), ('c', 1)], [('a', 4), ('b', 1), ('c', 4)], [('a', 4), ('b', 4), ('c', 1)], [('a', 4), ('b', 4), ('c', 4)]] + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [-3, 1]) + >>> problem.addVariable('c', [-2, 2]) + >>> problem.addConstraint(VariableMinSumConstraint('c', ['a', 'b'])) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[('a', -3), ('b', 1), ('c', -2)], [('a', 1), ('b', -3), ('c', -2)], [('a', 1), ('b', 1), ('c', -2)], [('a', 1), ('b', 1), ('c', 2)]] """ # noqa: E501 - def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): + def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): """Initialization method. Args: @@ -590,9 +665,14 @@ class MaxSumConstraint(Constraint): >>> problem.addConstraint(MaxSumConstraint(3)) >>> sorted(sorted(x.items()) for x in problem.getSolutions()) [[('a', 1), ('b', 1)], [('a', 1), ('b', 2)], [('a', 2), ('b', 1)]] + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [-3, 1]) + >>> problem.addConstraint(MaxSumConstraint(-2)) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[('a', -3), ('b', -3)], [('a', -3), ('b', 1)], [('a', 1), ('b', -3)]] """ - def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): + def __init__(self, maxsum: int | float, multipliers: Sequence | None = None): """Initialization method. Args: @@ -603,55 +683,48 @@ def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = """ self._maxsum = maxsum self._multipliers = multipliers + self._var_min = {} + self._var_is_negative = {} def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 Constraint.preProcess(self, variables, domains, constraints, vconstraints) - - # check if there are any negative values in the associated variables - variable_contains_negative: list[bool] = list() - variable_with_negative = None - for variable in variables: - contains_negative = any(value < 0 for value in domains[variable]) - variable_contains_negative.append(contains_negative) - if contains_negative: - if variable_with_negative is not None: - # if more than one associated variables contain negative, we can't prune - return - variable_with_negative = variable - - # prune the associated variables of values > maxsum - multipliers = self._multipliers + multipliers = self._multipliers if self._multipliers else [1] * len(variables) maxsum = self._maxsum - if multipliers: - for variable, multiplier in zip(variables, multipliers): - if variable_with_negative is not None and variable_with_negative != variable: - continue - domain = domains[variable] - for value in domain[:]: - if value * multiplier > maxsum: - domain.remove(value) - else: - for variable in variables: - if variable_with_negative is not None and variable_with_negative != variable: - continue - domain = domains[variable] - for value in domain[:]: - if value > maxsum: - domain.remove(value) + self._var_min = { variable: min(domains[variable]) * multiplier for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + + # preprocess the domains to remove values that cannot contribute to the sum + for variable, multiplier in zip(variables, multipliers): + domain = domains[variable] + other_vars_min = sum_other_vars(variables, variable, self._var_min) + for value in domain[:]: + if value * multiplier + other_vars_min > maxsum: + domain.remove(value) + + # recalculate the min after pruning + self._var_min = { variable: min(domains[variable]) * multiplier if len(domains[variable]) > 0 else 0 for variable, multiplier in zip(variables, multipliers) } # noqa: E501 + self._var_is_negative = { variable: self._var_min[variable] < 0 for variable in variables } def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 multipliers = self._multipliers maxsum = self._maxsum sum = 0 + min_sum_missing = 0 + missing = False + missing_negative = False if multipliers: for variable, multiplier in zip(variables, multipliers): if variable in assignments: sum += assignments[variable] * multiplier + else: + min_sum_missing += self._var_min[variable] + missing = True + if self._var_is_negative[variable]: + missing_negative = True if isinstance(sum, float): sum = round(sum, 10) - if sum > maxsum: + if sum + min_sum_missing > maxsum: return False - if forwardcheck: + if forwardcheck and missing and not missing_negative: for variable, multiplier in zip(variables, multipliers): if variable not in assignments: domain = domains[variable] @@ -664,11 +737,16 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar for variable in variables: if variable in assignments: sum += assignments[variable] + else: + min_sum_missing += self._var_min[variable] + missing = True + if self._var_is_negative[variable]: + missing_negative = True if isinstance(sum, float): sum = round(sum, 10) - if sum > maxsum: + if sum + min_sum_missing > maxsum: return False - if forwardcheck: + if forwardcheck and missing and not missing_negative: for variable in variables: if variable not in assignments: domain = domains[variable] @@ -689,9 +767,15 @@ class VariableMaxSumConstraint(Constraint): >>> problem.addConstraint(VariableMaxSumConstraint('c', ['a', 'b'])) >>> sorted(sorted(x.items()) for x in problem.getSolutions()) [[('a', 1), ('b', 1), ('c', 3)], [('a', 1), ('b', 1), ('c', 4)], [('a', 1), ('b', 3), ('c', 4)], [('a', 3), ('b', 1), ('c', 4)]] + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [-2, 1]) + >>> problem.addVariable('c', [-3, -1]) + >>> problem.addConstraint(VariableMaxSumConstraint('c', ['a', 'b'])) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[('a', -2), ('b', -2), ('c', -3)], [('a', -2), ('b', -2), ('c', -1)], [('a', -2), ('b', 1), ('c', -1)], [('a', 1), ('b', -2), ('c', -1)]] """ # noqa: E501 - def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Optional[Sequence] = None): + def __init__(self, target_var: str, sum_vars: Sequence[str], multipliers: Sequence | None = None): """Initialization method. Args: @@ -760,15 +844,21 @@ class ExactProdConstraint(Constraint): >>> problem.addConstraint(ExactProdConstraint(2)) >>> sorted(sorted(x.items()) for x in problem.getSolutions()) [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)]] + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [-2, -1, 1, 2]) + >>> problem.addConstraint(ExactProdConstraint(-2)) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[('a', -2), ('b', 1)], [('a', -1), ('b', 2)], [('a', 1), ('b', -2)], [('a', 2), ('b', -1)]] """ - def __init__(self, exactprod: Union[int, float]): + def __init__(self, exactprod: int | float): """Instantiate an ExactProdConstraint. Args: exactprod: Value to be considered as the product """ self._exactprod = exactprod + self._variable_contains_lt1: list[bool] = list() def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -803,6 +893,10 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar prod = 1 missing = False missing_lt1 = [] + # find out which variables contain values less than 1 if not preprocessed + if len(self._variable_contains_lt1) != len(variables): + for variable in variables: + self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): if variable in assignments: prod *= assignments[variable] @@ -834,6 +928,12 @@ class VariableExactProdConstraint(Constraint): >>> problem.addConstraint(VariableExactProdConstraint('c', ['a', 'b'])) >>> sorted(sorted(x.items()) for x in problem.getSolutions()) [[('a', 1), ('b', 1), ('c', 1)], [('a', 1), ('b', 2), ('c', 2)], [('a', 2), ('b', 1), ('c', 2)]] + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [-2, -1, 2]) + >>> problem.addVariable('c', [-2, 1]) + >>> problem.addConstraint(VariableExactProdConstraint('c', ['a', 'b'])) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[('a', -1), ('b', -1), ('c', 1)], [('a', -1), ('b', 2), ('c', -2)], [('a', 2), ('b', -1), ('c', -2)]] """ def __init__(self, target_var: str, product_vars: Sequence[str]): @@ -916,19 +1016,20 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar if target_value < possible_min or target_value > possible_max: return False - if forwardcheck: - for var in unassigned_vars: - others = [v for v in unassigned_vars if v != var] - others_bounds = [(min(domains[v]), max(domains[v])) for v in others] or [(1, 1)] - other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in others_bounds])] - - domain = domains[var] - for value in domain[:]: - candidates = [assigned_product * value * p for p in other_products] - if all(c != target_value for c in candidates): - domain.hideValue(value) - if not domain: - return False + # the below forwardcheck is incorrect for mixes of negative and positive values + # if forwardcheck: + # for var in unassigned_vars: + # others = [v for v in unassigned_vars if v != var] + # others_bounds = [(min(domains[v]), max(domains[v])) for v in others] or [(1, 1)] + # other_products = [self._safe_product(p) for p in product(*[(lo, hi) for lo, hi in others_bounds])] + + # domain = domains[var] + # for value in domain[:]: + # candidates = [assigned_product * value * p for p in other_products] + # if all(c != target_value for c in candidates): + # domain.hideValue(value) + # if not domain: + # return False return True @@ -942,9 +1043,14 @@ class MinProdConstraint(Constraint): >>> problem.addConstraint(MinProdConstraint(2)) >>> sorted(sorted(x.items()) for x in problem.getSolutions()) [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)], [('a', 2), ('b', 2)]] - """ + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [-2, -1, 1]) + >>> problem.addConstraint(MinProdConstraint(1)) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[('a', -2), ('b', -2)], [('a', -2), ('b', -1)], [('a', -1), ('b', -2)], [('a', -1), ('b', -1)], [('a', 1), ('b', 1)]] + """ # noqa: E501 - def __init__(self, minprod: Union[int, float]): + def __init__(self, minprod: int | float): """Instantiate a MinProdConstraint. Args: @@ -988,6 +1094,12 @@ class VariableMinProdConstraint(Constraint): >>> problem.addConstraint(VariableMinProdConstraint('c', ['a', 'b'])) >>> sorted(sorted(x.items()) for x in problem.getSolutions()) [[('a', -1), ('b', -1), ('c', -1)], [('a', 2), ('b', 2), ('c', -1)], [('a', 2), ('b', 2), ('c', 2)]] + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [-2, -1, 1]) + >>> problem.addVariable('c', [2, 5]) + >>> problem.addConstraint(VariableMinProdConstraint('c', ['a', 'b'])) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[('a', -2), ('b', -2), ('c', 2)], [('a', -2), ('b', -1), ('c', 2)], [('a', -1), ('b', -2), ('c', 2)]] """ def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 @@ -1084,15 +1196,21 @@ class MaxProdConstraint(Constraint): >>> problem.addConstraint(MaxProdConstraint(2)) >>> sorted(sorted(x.items()) for x in problem.getSolutions()) [[('a', 1), ('b', 1)], [('a', 1), ('b', 2)], [('a', 2), ('b', 1)]] + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [-2, -1, 1]) + >>> problem.addConstraint(MaxProdConstraint(-1)) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[('a', -2), ('b', 1)], [('a', -1), ('b', 1)], [('a', 1), ('b', -2)], [('a', 1), ('b', -1)]] """ - def __init__(self, maxprod: Union[int, float]): + def __init__(self, maxprod: int | float): """Instantiate a MaxProdConstraint. Args: maxprod: Value to be considered as the maximum product """ self._maxprod = maxprod + self._variable_contains_lt1: list[bool] = list() def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 Constraint.preProcess(self, variables, domains, constraints, vconstraints) @@ -1127,6 +1245,10 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar prod = 1 missing = False missing_lt1 = [] + # find out which variables contain values less than 1 if not preprocessed + if len(self._variable_contains_lt1) != len(variables): + for variable in variables: + self._variable_contains_lt1.append(any(value < 1 for value in domains[variable])) for variable, contains_lt1 in zip(variables, self._variable_contains_lt1): if variable in assignments: prod *= assignments[variable] @@ -1159,6 +1281,12 @@ class VariableMaxProdConstraint(Constraint): >>> problem.addConstraint(VariableMaxProdConstraint('c', ['a', 'b'])) >>> sorted(sorted(x.items()) for x in problem.getSolutions()) [[('a', -1), ('b', -1), ('c', 2)], [('a', -1), ('b', 2), ('c', -1)], [('a', -1), ('b', 2), ('c', 2)], [('a', 2), ('b', -1), ('c', -1)], [('a', 2), ('b', -1), ('c', 2)]] + >>> problem = Problem() + >>> problem.addVariables(["a", "b"], [-2, -1, 1]) + >>> problem.addVariable('c', [-2, -3]) + >>> problem.addConstraint(VariableMaxProdConstraint('c', ['a', 'b'])) + >>> sorted(sorted(x.items()) for x in problem.getSolutions()) + [[('a', -2), ('b', 1), ('c', -2)], [('a', 1), ('b', -2), ('c', -2)]] """ # noqa: E501 def __init__(self, target_var: str, product_vars: Sequence[str]): # noqa: D107 @@ -1436,3 +1564,10 @@ def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwar if found < self._n: return False return True + + +# Utility functions + +def sum_other_vars(variables: Sequence, variable, values: dict): + """Calculate the sum of the given values of all other variables.""" + return sum(values[v] for v in variables if v != variable) diff --git a/constraint/domain.c b/constraint/domain.c index 4278eb8..5b14059 100644 --- a/constraint/domain.c +++ b/constraint/domain.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.2 */ +/* Generated by Cython 3.2.9 */ /* BEGIN: Cython Metadata { @@ -19,8 +19,16 @@ END: Cython Metadata */ #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ /* InitLimitedAPI */ -#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) +#if defined(Py_LIMITED_API) + #if !defined(CYTHON_LIMITED_API) #define CYTHON_LIMITED_API 1 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef _MSC_VER + #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.") + #else + #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead. + #endif #endif #include "Python.h" @@ -29,8 +37,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_1_2" -#define CYTHON_HEX_VERSION 0x030102F0 +#define __PYX_ABI_VERSION "3_2_9" +#define CYTHON_HEX_VERSION 0x030209F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -55,9 +63,6 @@ END: Cython Metadata */ #define DL_EXPORT(t) t #endif #define __PYX_COMMA , -#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -#endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif @@ -90,7 +95,7 @@ END: Cython Metadata */ #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_ASSUME_SAFE_SIZE @@ -127,6 +132,8 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 @@ -194,6 +201,8 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX @@ -204,8 +213,6 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 - #undef CYTHON_CLINE_IN_TRACEBACK - #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS @@ -265,8 +272,11 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #ifndef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 1 + #endif + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 @@ -373,6 +383,15 @@ END: Cython Metadata */ #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif + #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work + #elif !defined(CYTHON_IMMORTAL_CONSTANTS) + #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) + #endif +#endif +#ifndef CYTHON_COMPRESS_STRINGS + #define CYTHON_COMPRESS_STRINGS 1 #endif #ifndef CYTHON_FAST_PYCCALL #define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL @@ -381,10 +400,9 @@ END: Cython Metadata */ #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #else -#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL) #endif #endif -#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #undef SHIFT #undef BASE @@ -460,35 +478,8 @@ END: Cython Metadata */ #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; - #endif - #endif - #if _MSC_VER < 1300 - #ifdef _WIN64 - typedef unsigned long long __pyx_uintptr_t; - #else - typedef unsigned int __pyx_uintptr_t; - #endif - #else - #ifdef _WIN64 - typedef unsigned __int64 __pyx_uintptr_t; - #else - typedef unsigned __int32 __pyx_uintptr_t; - #endif - #endif -#else - #include - typedef uintptr_t __pyx_uintptr_t; -#endif +#include +typedef uintptr_t __pyx_uintptr_t; #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 @@ -531,9 +522,9 @@ END: Cython Metadata */ #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000) #else - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) @@ -637,6 +628,12 @@ static int __Pyx_init_co_variables(void); #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif +#ifndef Py_TPFLAGS_IMMUTABLETYPE + #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8) +#endif +#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION + #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7) +#endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif @@ -669,11 +666,6 @@ static int __Pyx_init_co_variables(void); #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) -#elif CYTHON_BACKPORT_VECTORCALL - typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) @@ -703,7 +695,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(vo #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x03090000 +#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000) #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else @@ -720,6 +712,9 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(vo #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno)) #elif CYTHON_COMPILING_IN_GRAAL #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) @@ -810,7 +805,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #endif #define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) -#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#if CYTHON_USE_TYPE_SPECS #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ @@ -874,7 +869,10 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #endif #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else @@ -890,22 +888,55 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif -#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) - #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS +enum __Pyx_ReferenceSharing { + __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check + __Pyx_ReferenceSharing_OwnStrongReference, + __Pyx_ReferenceSharing_FunctionArgument, + __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar +}; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000 +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\ + (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\ + (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\ + (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0))) +#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1) +#else +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) #else #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i) #endif -#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS - #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE) + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) +#else + #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\ + __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +#endif +#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_PyList_GetItemRef(o, i)) +#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\ + __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ + __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i)) #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\ + __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ + __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i)) #endif +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_NewRef(PyList_GET_ITEM(o, i))) #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_XNewRef(PyList_GetItem(o, i))) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) @@ -966,15 +997,6 @@ static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) -#else - static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { - PyObject *module = PyImport_AddModule(name); - Py_XINCREF(module); - return module; - } -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif @@ -1081,15 +1103,6 @@ static int __Pyx_init_co_variables(void) { #endif #endif #include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else @@ -1138,6 +1151,15 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif +#ifdef CYTHON_FREETHREADING_COMPATIBLE +#if CYTHON_FREETHREADING_COMPATIBLE +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED +#else +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED +#endif +#else +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED +#endif #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING "" @@ -1340,7 +1362,7 @@ static const char* const __pyx_f[] = { "constraint/domain.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* Atomics.proto */ +/* Atomics.proto (used by UnpackUnboundCMethod) */ #include #ifndef CYTHON_ATOMICS #define CYTHON_ATOMICS 1 @@ -1376,6 +1398,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C atomics") #elif defined(__PYX_DEBUG_ATOMICS) @@ -1400,6 +1423,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C++ atomics") #elif defined(__PYX_DEBUG_ATOMICS) @@ -1409,6 +1433,7 @@ static const char* const __pyx_f[] = { (__GNUC_MINOR__ > 1 ||\ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) #define __pyx_atomic_ptr_type void* + #define __pyx_nonatomic_ptr_type void* #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1) @@ -1424,6 +1449,12 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value) + static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { + __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } #ifdef __PYX_DEBUG_ATOMICS #warning "Using GNU atomics" #endif @@ -1434,6 +1465,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_ptr_type void* #undef __pyx_nonatomic_int_type #define __pyx_nonatomic_int_type long + #define __pyx_nonatomic_ptr_type void* #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer) #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1) #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1) @@ -1450,6 +1482,12 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0) #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value) + static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { + __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } #ifdef __PYX_DEBUG_ATOMICS #pragma message ("Using MSVC atomics") #endif @@ -1460,36 +1498,27 @@ static const char* const __pyx_f[] = { #warning "Not using atomics" #endif #endif -#if CYTHON_ATOMICS - #define __pyx_add_acquisition_count(memview)\ - __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview)) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview)) -#else - #define __pyx_add_acquisition_count(memview)\ - __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) -#endif - -/* IncludeStructmemberH.proto */ -#include -/* CriticalSections.proto */ +/* CriticalSectionsDefinition.proto (used by CriticalSections) */ #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __Pyx_PyCriticalSection void* #define __Pyx_PyCriticalSection2 void* -#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs -#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs -#define __Pyx_PyCriticalSection_End1(cs) -#define __Pyx_PyCriticalSection_End2(cs) +#define __Pyx_PyCriticalSection_End(cs) +#define __Pyx_PyCriticalSection2_End(cs) #else #define __Pyx_PyCriticalSection PyCriticalSection #define __Pyx_PyCriticalSection2 PyCriticalSection2 -#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin -#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin -#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End -#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End +#define __Pyx_PyCriticalSection_End PyCriticalSection_End +#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End +#endif + +/* CriticalSections.proto (used by ParseKeywordsImpl) */ +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs) +#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs) +#else +#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin +#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin #endif #if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_BEGIN_CRITICAL_SECTION(o) { @@ -1499,6 +1528,9 @@ static const char* const __pyx_f[] = { #define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif +/* IncludeStructmemberH.proto (used by FixUpExtensionType) */ +#include + /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ @@ -1580,71 +1612,7 @@ static const char* const __pyx_f[] = { #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; -#if PY_VERSION_HEX >= 0x030C00A6 -#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) -#else -#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) -#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) -#endif -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) -#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 -#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) -#else -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#endif -#else -#define __Pyx_PyErr_Clear() PyErr_Clear() -#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* PyObjectGetAttrStrNoError.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* TupleAndListFromArray.proto */ +/* TupleAndListFromArray.proto (used by fastcall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1652,13 +1620,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_s static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif -/* IncludeStringH.proto */ +/* IncludeStringH.proto (used by BytesEquals) */ #include -/* BytesEquals.proto */ +/* BytesEquals.proto (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); -/* UnicodeEquals.proto */ +/* UnicodeEquals.proto (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ @@ -1691,25 +1659,16 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #endif #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) -#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#if CYTHON_METH_FASTCALL #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start) #else -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS #endif -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static CYTHON_INLINE int __Pyx_ParseKeywords( - PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], - PyObject *kwds2, PyObject *values[], - Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, - const char* function_name, - int ignore_unknown_kwargs -); +/* py_dict_items.proto (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); -/* CallCFunction.proto */ +/* CallCFunction.proto (used by CallUnboundCMethod0) */ #define __Pyx_CallCFunction(cfunc, self, args)\ ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) #define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ @@ -1719,52 +1678,33 @@ static CYTHON_INLINE int __Pyx_ParseKeywords( #define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\ ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames) -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#if !CYTHON_VECTORCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs); -#endif -#define __Pyx_BUILD_ASSERT_EXPR(cond)\ - (sizeof(char [1 - 2*!(cond)]) - 1) -#ifndef Py_MEMBER_SIZE -#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) -#endif -#if !CYTHON_VECTORCALL -#if PY_VERSION_HEX >= 0x03080000 - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets() - #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) -#else - static size_t __pyx_pyframe_localsplus_offset = 0; - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets()\ - ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ - (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) - #define __Pyx_PyFrame_GetLocalsplus(frame)\ - (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) -#endif -#endif -#endif - -/* PyObjectCall.proto */ +/* PyObjectCall.proto (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif -/* PyObjectCallMethO.proto */ +/* PyObjectCallMethO.proto (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif -/* PyObjectFastCall.proto */ +/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); -/* UnpackUnboundCMethod.proto */ +/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* PyObjectGetAttrStr.proto (used by UnpackUnboundCMethod) */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */ typedef struct { PyObject *type; PyObject **method_name; @@ -1797,6 +1737,59 @@ static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_Ca #define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) #endif +/* CallUnboundCMethod0.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + +/* py_dict_values.proto (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); + +/* OwnedDictNext.proto (used by ParseKeywordsImpl) */ +#if CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue); +#else +CYTHON_INLINE +static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue); +#endif + +/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywordsImpl.export */ +static int __Pyx_ParseKeywordsTuple( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name +); +static int __Pyx_ParseKeywordDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + /* CallUnboundCMethod2.proto */ CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); @@ -1806,11 +1799,20 @@ static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction * #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif +/* ParseKeywords.proto */ +static CYTHON_INLINE int __Pyx_ParseKeywords( + PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], + PyObject *kwds2, PyObject *values[], + Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); -/* PyObjectDelAttr.proto */ +/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 #define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL) #else @@ -1841,7 +1843,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice( PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); -/* ListAppend.proto */ +/* ListAppend.proto (used by append) */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; @@ -1862,25 +1864,24 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif -/* PyObjectCall2Args.proto */ +/* PyObjectCall2Args.proto (used by PyObjectCallMethod1) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* PyObjectGetMethod.proto */ +/* PyObjectGetMethod.proto (used by PyObjectCallMethod1) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); +#endif -/* PyObjectCallMethod1.proto */ +/* PyObjectCallMethod1.proto (used by append) */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); -/* PyObjectCallNoArg.proto */ +/* PyObjectCallNoArg.proto (used by PyObjectCallMethod0) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); -/* PyObjectCallMethod0.proto */ +/* PyObjectCallMethod0.proto (used by pop) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* pop.proto */ @@ -1894,62 +1895,61 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); #define __Pyx_PyObject_Pop(L) __Pyx__PyObject_Pop(L) #endif -/* CallUnboundCMethod0.proto */ -CYTHON_UNUSED -static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); -#else -#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) -#endif - /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); -/* LimitedApiGetTypeDict.proto */ +/* dict_setdefault.proto (used by FetchCommonType) */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value); + +/* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); #endif -/* SetItemOnTypeDict.proto */ +/* SetItemOnTypeDict.proto (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v); #define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v) -/* FixUpExtensionType.proto */ +/* FixUpExtensionType.proto (used by FetchCommonType) */ static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -/* FetchSharedCythonModule.proto */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void); +/* AddModuleRef.proto (used by FetchSharedCythonModule) */ +#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\ + __PYX_LIMITED_VERSION_HEX < 0x030d0000) + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name); +#else + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#endif -/* dict_setdefault.proto */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); +/* FetchSharedCythonModule.proto (used by FetchCommonType) */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); -/* FetchCommonType.proto */ +/* FetchCommonType.proto (used by CommonTypesMetaclass) */ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); -/* CommonTypesMetaclass.proto */ +/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */ static int __pyx_CommonTypesMetaclass_init(PyObject *module); #define __Pyx_CommonTypesMetaclass_USED -/* CallTypeTraverse.proto */ +/* CallTypeTraverse.proto (used by CythonFunctionShared) */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 #else static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif -/* PyMethodNew.proto */ +/* PyMethodNew.proto (used by CythonFunctionShared) */ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); -/* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */ +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif -/* CythonFunctionShared.proto */ +/* CythonFunctionShared.proto (used by CythonFunction) */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 @@ -1979,14 +1979,15 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL ||\ - (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) +#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL __pyx_vectorcallfunc func_vectorcall; #endif #if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_dict; +#endif PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; @@ -2031,7 +2032,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) @@ -2056,40 +2057,97 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif -/* CalculateMetaclass.proto */ +/* CalculateMetaclass.proto (used by Py3ClassCreate) */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); -/* PyObjectLookupSpecial.proto */ -#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS -#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) -#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) -static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); +/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else -#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) -#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif -/* Py3ClassCreate.proto */ -static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, - PyObject *mkw, PyObject *modname, PyObject *doc); -static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, - PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); - -/* PyDictVersioning.proto */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) -#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) -#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ - (version_var) = __PYX_GET_DICT_VERSION(dict);\ - (cache_var) = (value); -#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ - } else {\ - (VAR) = __pyx_dict_cached_value = (LOOKUP);\ - __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ +/* PyThreadStateGet.proto (used by PyErrFetchRestore) */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto (used by PyObjectGetAttrStrNoError) */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* PyObjectGetAttrStrNoError.proto (used by Py3ClassCreate) */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* PyObjectLookupSpecial.proto (used by Py3ClassCreate) */ +#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS +#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) +#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) +static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); +#else +#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) +#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) +#endif + +/* Py3ClassCreate.proto */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, + PyObject *mkw, PyObject *modname, PyObject *doc); +static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, + PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); + +/* GetBuiltinName.proto (used by GetModuleGlobalName) */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* PyDictVersioning.proto (used by GetModuleGlobalName) */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); @@ -2125,14 +2183,14 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); -/* CLineInTraceback.proto */ +/* CLineInTraceback.proto (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #else #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif -/* CodeObjectCache.proto */ +/* CodeObjectCache.proto (used by AddTraceback) */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject __Pyx_CachedCodeObjectType; #else @@ -2175,12 +2233,12 @@ typedef const char *__Pyx_TypeName; #define __Pyx_DECREF_TypeName(obj) #endif -/* GCCDiagnostics.proto */ +/* GCCDiagnostics.proto (used by CIntToPy) */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif -/* PyObjectVectorCallKwBuilder.proto */ +/* PyObjectVectorCallKwBuilder.proto (used by CIntToPy) */ CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); #if CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03090000 @@ -2232,11 +2290,20 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #endif /* GetRuntimeVersion.proto */ +#if __PYX_LIMITED_VERSION_HEX < 0x030b0000 +static unsigned long __Pyx_cached_runtime_version = 0; +static void __Pyx_init_runtime_version(void); +#else +#define __Pyx_init_runtime_version() +#endif static unsigned long __Pyx_get_runtime_version(void); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); +/* DecompressString.proto */ +static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo); + /* MultiPhaseInitModuleState.proto */ #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE static PyObject *__Pyx_State_FindModule(void*); @@ -2294,68 +2361,7 @@ int __pyx_module_is_main_constraint__domain = 0; /* Implementation of "constraint.domain" */ /* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_ImportError; -static PyObject *__pyx_builtin_ModuleNotFoundError; /* #### Code section: string_decls ### */ -static const char __pyx_k_[] = "?"; -static const char __pyx_k_doc[] = "__doc__"; -static const char __pyx_k_pop[] = "pop"; -static const char __pyx_k_set[] = "set"; -static const char __pyx_k_A_HA[] = "\200A\360\016\000\t\r\210H\220A"; -static const char __pyx_k_A_t1[] = "\200A\340\010\017\210t\2201"; -static const char __pyx_k_bool[] = "bool"; -static const char __pyx_k_diff[] = "diff"; -static const char __pyx_k_func[] = "__func__"; -static const char __pyx_k_init[] = "__init__"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_name[] = "name"; -static const char __pyx_k_repr[] = "__repr__"; -static const char __pyx_k_self[] = "self"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_value[] = "value"; -static const char __pyx_k_Domain[] = "Domain"; -static const char __pyx_k_append[] = "append"; -static const char __pyx_k_extend[] = "extend"; -static const char __pyx_k_hidden[] = "_hidden"; -static const char __pyx_k_module[] = "__module__"; -static const char __pyx_k_name_2[] = "__name__"; -static const char __pyx_k_remove[] = "remove"; -static const char __pyx_k_return[] = "return"; -static const char __pyx_k_states[] = "_states"; -static const char __pyx_k_1_q_s_q[] = "\320\000\033\2301\360\014\000\005\006\360\006\000\t\020\210q\330\013\027\220s\230!\330\010\017\210q"; -static const char __pyx_k_A_HG1Cq[] = "\200A\360\n\000\t\r\210H\220G\2301\230C\230q\240\001"; -static const char __pyx_k_prepare[] = "__prepare__"; -static const char __pyx_k_Variable[] = "Variable"; -static const char __pyx_k_popState[] = "popState"; -static const char __pyx_k_qualname[] = "__qualname__"; -static const char __pyx_k_set_name[] = "__set_name__"; -static const char __pyx_k_A_G1D_D_D[] = "\200A\340\010\014\210G\2201\220D\230\001\330\010\014\210D\220\010\230\001\330\010\014\210D\220\010\230\001"; -static const char __pyx_k_hideValue[] = "hideValue"; -static const char __pyx_k_metaclass[] = "__metaclass__"; -static const char __pyx_k_pushState[] = "pushState"; -static const char __pyx_k_A_G1F_HG1A[] = "\200A\360\022\000\t\r\210G\2201\220F\230!\330\010\014\210H\220G\2301\230A"; -static const char __pyx_k_Unassigned[] = "Unassigned"; -static const char __pyx_k_resetState[] = "resetState"; -static const char __pyx_k_ImportError[] = "ImportError"; -static const char __pyx_k_mro_entries[] = "__mro_entries__"; -static const char __pyx_k_A_IQfA_Kq_Kq[] = "\200A\360\014\000\t\r\210I\220Q\220f\230A\330\010\014\210K\220q\330\010\014\210K\220q"; -static const char __pyx_k_is_coroutine[] = "_is_coroutine"; -static const char __pyx_k_Domain___init[] = "Domain.__init__"; -static const char __pyx_k_Domain_popState[] = "Domain.popState"; -static const char __pyx_k_Variable___init[] = "Variable.__init__"; -static const char __pyx_k_Variable___repr[] = "Variable.__repr__"; -static const char __pyx_k_Domain_hideValue[] = "Domain.hideValue"; -static const char __pyx_k_Domain_pushState[] = "Domain.pushState"; -static const char __pyx_k_Domain_resetState[] = "Domain.resetState"; -static const char __pyx_k_check_if_compiled[] = "check_if_compiled"; -static const char __pyx_k_constraint_domain[] = "constraint.domain"; -static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; -static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_ModuleNotFoundError[] = "ModuleNotFoundError"; -static const char __pyx_k_constraint_domain_py[] = "constraint/domain.py"; -static const char __pyx_k_A_t84s_Cq_1_q_HAQa_HAQa[] = "\200A\360\n\000\t\020\210t\2208\2304\230s\240\"\240C\240q\250\001\330\010\013\2101\330\014\020\220\007\220q\230\004\230H\240A\240Q\240a\330\014\020\220\004\220H\230A\230Q\230a"; -static const char __pyx_k_Class_used_to_control_possible_v[] = "Class used to control possible values for variables.\n\n When list or tuples are used as domains, they are automatically\n converted to an instance of that class.\n "; -static const char __pyx_k_Helper_class_for_variable_defini[] = "Helper class for variable definition.\n\n Using this class is optional, since any hashable object,\n including plain strings and integers, may be used as variables.\n "; static const char __pyx_k_Module_containing_the_code_for_t[] = "Module containing the code for the Variable and Domain classes."; /* #### Code section: decls ### */ static PyObject *__pyx_pf_10constraint_6domain_check_if_compiled(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ @@ -2386,29 +2392,13 @@ typedef struct { PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED - PyTypeObject *__pyx_CyFunctionType; - #endif - #ifdef __Pyx_FusedFunction_USED - PyTypeObject *__pyx_FusedFunctionType; - #endif - #ifdef __Pyx_Generator_USED - PyTypeObject *__pyx_GeneratorType; - #endif - #ifdef __Pyx_IterableCoroutine_USED - PyTypeObject *__pyx_IterableCoroutineType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineAwaitType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineType; - #endif + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values; __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop; PyObject *__pyx_slice[1]; PyObject *__pyx_codeobj_tab[8]; - PyObject *__pyx_string_tab[51]; + PyObject *__pyx_string_tab[62]; /* #### Code section: module_state_contents ### */ /* CommonTypesMetaclass.module_state_decls */ PyTypeObject *__pyx_CommonTypesMetaclassType; @@ -2418,6 +2408,9 @@ PyTypeObject *__pyx_CommonTypesMetaclassType; PyObject *__Pyx_CachedMethodType; #endif +/* CythonFunctionShared.module_state_decls */ +PyTypeObject *__pyx_CyFunctionType; + /* CodeObjectCache.module_state_decls */ struct __Pyx_CodeObjectCache __pyx_code_cache; @@ -2448,26 +2441,26 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati /* #### Code section: constant_name_defines ### */ #define __pyx_kp_u_ __pyx_string_tab[0] #define __pyx_kp_u_Class_used_to_control_possible_v __pyx_string_tab[1] -#define __pyx_n_u_Domain __pyx_string_tab[2] -#define __pyx_n_u_Domain___init __pyx_string_tab[3] -#define __pyx_n_u_Domain_hideValue __pyx_string_tab[4] -#define __pyx_n_u_Domain_popState __pyx_string_tab[5] -#define __pyx_n_u_Domain_pushState __pyx_string_tab[6] -#define __pyx_n_u_Domain_resetState __pyx_string_tab[7] -#define __pyx_kp_u_Helper_class_for_variable_defini __pyx_string_tab[8] -#define __pyx_n_u_ImportError __pyx_string_tab[9] -#define __pyx_n_u_ModuleNotFoundError __pyx_string_tab[10] +#define __pyx_kp_u_Helper_class_for_variable_defini __pyx_string_tab[2] +#define __pyx_kp_u_constraint_domain_py __pyx_string_tab[3] +#define __pyx_n_u_Domain __pyx_string_tab[4] +#define __pyx_n_u_Domain___init __pyx_string_tab[5] +#define __pyx_n_u_Domain_hideValue __pyx_string_tab[6] +#define __pyx_n_u_Domain_popState __pyx_string_tab[7] +#define __pyx_n_u_Domain_pushState __pyx_string_tab[8] +#define __pyx_n_u_Domain_resetState __pyx_string_tab[9] +#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[10] #define __pyx_n_u_Unassigned __pyx_string_tab[11] #define __pyx_n_u_Variable __pyx_string_tab[12] #define __pyx_n_u_Variable___init __pyx_string_tab[13] #define __pyx_n_u_Variable___repr __pyx_string_tab[14] -#define __pyx_n_u_append __pyx_string_tab[15] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[16] -#define __pyx_n_u_bool __pyx_string_tab[17] -#define __pyx_n_u_check_if_compiled __pyx_string_tab[18] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[19] -#define __pyx_n_u_constraint_domain __pyx_string_tab[20] -#define __pyx_kp_u_constraint_domain_py __pyx_string_tab[21] +#define __pyx_n_u_annotate __pyx_string_tab[15] +#define __pyx_n_u_append __pyx_string_tab[16] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[17] +#define __pyx_n_u_bool __pyx_string_tab[18] +#define __pyx_n_u_check_if_compiled __pyx_string_tab[19] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[20] +#define __pyx_n_u_constraint_domain __pyx_string_tab[21] #define __pyx_n_u_diff __pyx_string_tab[22] #define __pyx_n_u_doc __pyx_string_tab[23] #define __pyx_n_u_extend __pyx_string_tab[24] @@ -2476,27 +2469,38 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_hideValue __pyx_string_tab[27] #define __pyx_n_u_init __pyx_string_tab[28] #define __pyx_n_u_is_coroutine __pyx_string_tab[29] -#define __pyx_n_u_main __pyx_string_tab[30] -#define __pyx_n_u_metaclass __pyx_string_tab[31] -#define __pyx_n_u_module __pyx_string_tab[32] -#define __pyx_n_u_mro_entries __pyx_string_tab[33] -#define __pyx_n_u_name __pyx_string_tab[34] -#define __pyx_n_u_name_2 __pyx_string_tab[35] -#define __pyx_n_u_pop __pyx_string_tab[36] -#define __pyx_n_u_popState __pyx_string_tab[37] -#define __pyx_n_u_prepare __pyx_string_tab[38] -#define __pyx_n_u_pushState __pyx_string_tab[39] -#define __pyx_n_u_qualname __pyx_string_tab[40] -#define __pyx_n_u_remove __pyx_string_tab[41] -#define __pyx_n_u_repr __pyx_string_tab[42] -#define __pyx_n_u_resetState __pyx_string_tab[43] -#define __pyx_n_u_return __pyx_string_tab[44] -#define __pyx_n_u_self __pyx_string_tab[45] -#define __pyx_n_u_set __pyx_string_tab[46] -#define __pyx_n_u_set_name __pyx_string_tab[47] -#define __pyx_n_u_states __pyx_string_tab[48] -#define __pyx_n_u_test __pyx_string_tab[49] -#define __pyx_n_u_value __pyx_string_tab[50] +#define __pyx_n_u_items __pyx_string_tab[30] +#define __pyx_n_u_main __pyx_string_tab[31] +#define __pyx_n_u_metaclass __pyx_string_tab[32] +#define __pyx_n_u_module __pyx_string_tab[33] +#define __pyx_n_u_mro_entries __pyx_string_tab[34] +#define __pyx_n_u_name __pyx_string_tab[35] +#define __pyx_n_u_name_2 __pyx_string_tab[36] +#define __pyx_n_u_pop __pyx_string_tab[37] +#define __pyx_n_u_popState __pyx_string_tab[38] +#define __pyx_n_u_prepare __pyx_string_tab[39] +#define __pyx_n_u_pushState __pyx_string_tab[40] +#define __pyx_n_u_qualname __pyx_string_tab[41] +#define __pyx_n_u_remove __pyx_string_tab[42] +#define __pyx_n_u_repr __pyx_string_tab[43] +#define __pyx_n_u_resetState __pyx_string_tab[44] +#define __pyx_n_u_return __pyx_string_tab[45] +#define __pyx_n_u_self __pyx_string_tab[46] +#define __pyx_n_u_set __pyx_string_tab[47] +#define __pyx_n_u_set_name __pyx_string_tab[48] +#define __pyx_n_u_setdefault __pyx_string_tab[49] +#define __pyx_n_u_states __pyx_string_tab[50] +#define __pyx_n_u_test __pyx_string_tab[51] +#define __pyx_n_u_value __pyx_string_tab[52] +#define __pyx_n_u_values __pyx_string_tab[53] +#define __pyx_kp_b_iso88591_1_q_s_q __pyx_string_tab[54] +#define __pyx_kp_b_iso88591_A_G1D_D_D __pyx_string_tab[55] +#define __pyx_kp_b_iso88591_A_G1F_HG1A __pyx_string_tab[56] +#define __pyx_kp_b_iso88591_A_HA __pyx_string_tab[57] +#define __pyx_kp_b_iso88591_A_HG1Cq __pyx_string_tab[58] +#define __pyx_kp_b_iso88591_A_IQfA_Kq_Kq __pyx_string_tab[59] +#define __pyx_kp_b_iso88591_A_t1 __pyx_string_tab[60] +#define __pyx_kp_b_iso88591_A_t84s_Cq_1_q_HAQa_HAQa __pyx_string_tab[61] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -2508,19 +2512,21 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif #if CYTHON_PEP489_MULTI_PHASE_INIT __Pyx_State_RemoveModule(NULL); #endif for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } for (int i=0; i<8; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<51; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } - return 0; + for (int i=0; i<62; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } +/* #### Code section: module_state_clear_contents ### */ +/* CommonTypesMetaclass.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType); + +/* CythonFunctionShared.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + +/* #### Code section: module_state_clear_end ### */ +return 0; } #endif /* #### Code section: module_state_traverse ### */ @@ -2534,16 +2540,18 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); - #endif for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } for (int i=0; i<8; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<51; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } - return 0; + for (int i=0; i<62; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } +/* #### Code section: module_state_traverse_contents ### */ +/* CommonTypesMetaclass.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType); + +/* CythonFunctionShared.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + +/* #### Code section: module_state_traverse_end ### */ +return 0; } #endif /* #### Code section: module_code ### */ @@ -2680,7 +2688,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_name,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 30, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 30, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: @@ -2695,7 +2703,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 30, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 30, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 30, __pyx_L3_error) } } @@ -2748,7 +2756,7 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable___init__(CYTHON_UNUSED * * def __repr__(self): */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_name, __pyx_v_name) < 0) __PYX_ERR(0, 37, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_name, __pyx_v_name) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) /* "constraint/domain.py":30 * """ @@ -2818,7 +2826,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 39, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 39, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: @@ -2829,7 +2837,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < 0) __PYX_ERR(0, 39, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < (0)) __PYX_ERR(0, 39, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, i); __PYX_ERR(0, 39, __pyx_L3_error) } } @@ -2955,7 +2963,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_set,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 59, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 59, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: @@ -2970,7 +2978,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 59, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 59, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 59, __pyx_L3_error) } } @@ -3031,7 +3039,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py __pyx_t_3 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_set}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -3047,7 +3055,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hidden, __pyx_t_1) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hidden, __pyx_t_1) < (0)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/domain.py":67 @@ -3059,7 +3067,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_states, __pyx_t_1) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_states, __pyx_t_1) < (0)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/domain.py":59 @@ -3132,7 +3140,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 69, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 69, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: @@ -3143,7 +3151,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "resetState", 0) < 0) __PYX_ERR(0, 69, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "resetState", 0) < (0)) __PYX_ERR(0, 69, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("resetState", 1, 1, 1, i); __PYX_ERR(0, 69, __pyx_L3_error) } } @@ -3204,7 +3212,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_extend, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_extend, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) @@ -3221,7 +3229,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hidden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_DelSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + if (__Pyx_PyObject_DelSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < (0)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/domain.py":73 @@ -3233,7 +3241,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_DelSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + if (__Pyx_PyObject_DelSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < (0)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/domain.py":69 @@ -3307,7 +3315,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 75, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 75, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: @@ -3318,7 +3326,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "pushState", 0) < 0) __PYX_ERR(0, 75, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "pushState", 0) < (0)) __PYX_ERR(0, 75, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("pushState", 1, 1, 1, i); __PYX_ERR(0, 75, __pyx_L3_error) } } @@ -3451,7 +3459,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 82, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 82, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: @@ -3462,7 +3470,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "popState", 0) < 0) __PYX_ERR(0, 82, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "popState", 0) < (0)) __PYX_ERR(0, 82, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("popState", 1, 1, 1, i); __PYX_ERR(0, 82, __pyx_L3_error) } } @@ -3566,7 +3574,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_7}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_extend, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_extend, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error) @@ -3585,7 +3593,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyNumber_Negative(__pyx_v_diff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_PyObject_DelSlice(__pyx_t_4, 0, 0, &__pyx_t_7, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + if (__Pyx_PyObject_DelSlice(__pyx_t_4, 0, 0, &__pyx_t_7, NULL, NULL, 0, 0, 1) < (0)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -3673,7 +3681,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_value,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 92, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 92, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: @@ -3688,7 +3696,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "hideValue", 0) < 0) __PYX_ERR(0, 92, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "hideValue", 0) < (0)) __PYX_ERR(0, 92, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("hideValue", 1, 2, 2, i); __PYX_ERR(0, 92, __pyx_L3_error) } } @@ -3749,7 +3757,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_8hideValue(CYTHON_UNUSED __pyx_t_3 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_value}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -3877,7 +3885,7 @@ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_domain}, #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - {Py_mod_gil, Py_MOD_GIL_USED}, + {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE}, #endif #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, @@ -3939,7 +3947,8 @@ __Pyx_PyMODINIT_FUNC PyInit_domain(void) return PyModuleDef_Init(&__pyx_moduledef); } /* ModuleCreationPEP489 */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ + || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { { PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think @@ -3969,12 +3978,15 @@ static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { #if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { static PY_INT64_T main_interpreter_id = -1; -#if CYTHON_COMPILING_IN_GRAAL +#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 + PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#elif CYTHON_COMPILING_IN_GRAAL PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000 - PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API +#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ + || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#elif CYTHON_COMPILING_IN_LIMITED_API + PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); #else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); #endif @@ -4092,48 +4104,28 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_domain(PyObject *__pyx_pyinit_modu if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /* ImportRefnannyAPI */ #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - -__Pyx_RefNannySetupContext("PyInit_domain", 0); - if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } #endif + +__Pyx_RefNannySetupContext("PyInit_domain", 0); + __Pyx_init_runtime_version(); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Library function declarations ---*/ /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED) - if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ + if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error) if (__pyx_module_is_main_constraint__domain) { - if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) } { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -4142,10 +4134,10 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); } } /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(__pyx_mstate); (void)__Pyx_modinit_variable_export_code(__pyx_mstate); @@ -4165,12 +4157,15 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); */ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 4, __pyx_L1_error) __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_1check_if_compiled, 0, __pyx_mstate_global->__pyx_n_u_check_if_compiled, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_3); + #endif __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_check_if_compiled, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_check_if_compiled, __pyx_t_3) < (0)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":23 @@ -4192,7 +4187,10 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_8Variable_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Variable___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < (0)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/domain.py":39 @@ -4204,7 +4202,10 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_8Variable_3__repr__, 0, __pyx_mstate_global->__pyx_n_u_Variable___repr, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_repr, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_repr, __pyx_t_2) < (0)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/domain.py":23 @@ -4216,7 +4217,10 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); */ __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Variable, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Variable, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Variable, __pyx_t_2) < (0)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4233,13 +4237,13 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); __pyx_t_5 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Unassigned}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Unassigned, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Unassigned, __pyx_t_3) < (0)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":52 @@ -4271,7 +4275,10 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Domain___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_3); + #endif + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < (0)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":69 @@ -4283,7 +4290,10 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_3resetState, 0, __pyx_mstate_global->__pyx_n_u_Domain_resetState, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_resetState, __pyx_t_3) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_3); + #endif + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_resetState, __pyx_t_3) < (0)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":75 @@ -4295,7 +4305,10 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_5pushState, 0, __pyx_mstate_global->__pyx_n_u_Domain_pushState, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pushState, __pyx_t_3) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_3); + #endif + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pushState, __pyx_t_3) < (0)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":82 @@ -4307,7 +4320,10 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_7popState, 0, __pyx_mstate_global->__pyx_n_u_Domain_popState, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_popState, __pyx_t_3) < 0) __PYX_ERR(0, 82, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_3); + #endif + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_popState, __pyx_t_3) < (0)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":92 @@ -4319,7 +4335,10 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_9hideValue, 0, __pyx_mstate_global->__pyx_n_u_Domain_hideValue, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_hideValue, __pyx_t_3) < 0) __PYX_ERR(0, 92, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_3); + #endif + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_hideValue, __pyx_t_3) < (0)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":52 @@ -4331,7 +4350,10 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); */ __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Domain, __pyx_t_4, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Domain, __pyx_t_3) < 0) __PYX_ERR(0, 52, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_3); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Domain, __pyx_t_3) < (0)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4344,7 +4366,7 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); */ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*--- Wrapped vars code ---*/ @@ -4382,97 +4404,21 @@ __Pyx_RefNannySetupContext("PyInit_domain", 0); #endif } /* #### Code section: pystring_table ### */ - -typedef struct { - const char *s; -#if 176 <= 65535 - const unsigned short n; -#elif 176 / 2 < INT_MAX - const unsigned int n; -#elif 176 / 2 < LONG_MAX - const unsigned long n; -#else - const Py_ssize_t n; -#endif -#if 1 <= 31 - const unsigned int encoding : 5; -#elif 1 <= 255 - const unsigned char encoding; -#elif 1 <= 65535 - const unsigned short encoding; -#else - const Py_ssize_t encoding; -#endif - const unsigned int is_unicode : 1; - const unsigned int intern : 1; -} __Pyx_StringTabEntry; -static const char * const __pyx_string_tab_encodings[] = { 0 }; -static const __Pyx_StringTabEntry __pyx_string_tab[] = { - {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ - {__pyx_k_Class_used_to_control_possible_v, sizeof(__pyx_k_Class_used_to_control_possible_v), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Class_used_to_control_possible_v */ - {__pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain */ - {__pyx_k_Domain___init, sizeof(__pyx_k_Domain___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain___init */ - {__pyx_k_Domain_hideValue, sizeof(__pyx_k_Domain_hideValue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain_hideValue */ - {__pyx_k_Domain_popState, sizeof(__pyx_k_Domain_popState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain_popState */ - {__pyx_k_Domain_pushState, sizeof(__pyx_k_Domain_pushState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain_pushState */ - {__pyx_k_Domain_resetState, sizeof(__pyx_k_Domain_resetState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain_resetState */ - {__pyx_k_Helper_class_for_variable_defini, sizeof(__pyx_k_Helper_class_for_variable_defini), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Helper_class_for_variable_defini */ - {__pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ImportError */ - {__pyx_k_ModuleNotFoundError, sizeof(__pyx_k_ModuleNotFoundError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ModuleNotFoundError */ - {__pyx_k_Unassigned, sizeof(__pyx_k_Unassigned), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Unassigned */ - {__pyx_k_Variable, sizeof(__pyx_k_Variable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Variable */ - {__pyx_k_Variable___init, sizeof(__pyx_k_Variable___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Variable___init */ - {__pyx_k_Variable___repr, sizeof(__pyx_k_Variable___repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Variable___repr */ - {__pyx_k_append, sizeof(__pyx_k_append), 0, 1, 1}, /* PyObject cname: __pyx_n_u_append */ - {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */ - {__pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bool */ - {__pyx_k_check_if_compiled, sizeof(__pyx_k_check_if_compiled), 0, 1, 1}, /* PyObject cname: __pyx_n_u_check_if_compiled */ - {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ - {__pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_domain */ - {__pyx_k_constraint_domain_py, sizeof(__pyx_k_constraint_domain_py), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_constraint_domain_py */ - {__pyx_k_diff, sizeof(__pyx_k_diff), 0, 1, 1}, /* PyObject cname: __pyx_n_u_diff */ - {__pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_doc */ - {__pyx_k_extend, sizeof(__pyx_k_extend), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extend */ - {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */ - {__pyx_k_hidden, sizeof(__pyx_k_hidden), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden */ - {__pyx_k_hideValue, sizeof(__pyx_k_hideValue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hideValue */ - {__pyx_k_init, sizeof(__pyx_k_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_init */ - {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */ - {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ - {__pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaclass */ - {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ - {__pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mro_entries */ - {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ - {__pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name_2 */ - {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ - {__pyx_k_popState, sizeof(__pyx_k_popState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_popState */ - {__pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prepare */ - {__pyx_k_pushState, sizeof(__pyx_k_pushState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pushState */ - {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ - {__pyx_k_remove, sizeof(__pyx_k_remove), 0, 1, 1}, /* PyObject cname: __pyx_n_u_remove */ - {__pyx_k_repr, sizeof(__pyx_k_repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_repr */ - {__pyx_k_resetState, sizeof(__pyx_k_resetState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_resetState */ - {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */ - {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */ - {__pyx_k_set, sizeof(__pyx_k_set), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set */ - {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */ - {__pyx_k_states, sizeof(__pyx_k_states), 0, 1, 1}, /* PyObject cname: __pyx_n_u_states */ - {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ - {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ - {0, 0, 0, 0, 0} -}; -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); - /* #### Code section: cached_builtins ### */ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 14, __pyx_L1_error) - __pyx_builtin_ModuleNotFoundError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ModuleNotFoundError); if (!__pyx_builtin_ModuleNotFoundError) __PYX_ERR(0, 14, __pyx_L1_error) + + /* Cached unbound methods */ + __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; + __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values; + __pyx_mstate->__pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; + __pyx_mstate->__pyx_umethod_PyList_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; return 0; - __pyx_L1_error:; - return -1; } /* #### Code section: cached_constants ### */ @@ -4491,6 +4437,29 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_slice; + for (Py_ssize_t i=0; i<1; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -4501,33 +4470,110 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; - __pyx_mstate->__pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; - __pyx_mstate->__pyx_umethod_PyList_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; - if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + { + const struct { const unsigned int length: 8; } index[] = {{1},{170},{172},{20},{6},{15},{16},{15},{16},{17},{20},{10},{8},{17},{17},{12},{6},{18},{4},{17},{18},{17},{4},{7},{6},{8},{7},{9},{8},{13},{5},{8},{13},{10},{15},{4},{8},{3},{8},{11},{9},{12},{6},{8},{10},{6},{4},{3},{12},{10},{7},{8},{5},{6},{29},{31},{26},{11},{19},{29},{9},{58}}; + #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (648 bytes) */ +const char* const cstring = "(\265/\375`5\003\365\023\000\306aj2`o:0\230\322\030\206ab\31543G\013\214\263\270S\222{\213L\177h\217\235DN\35519\3151\255\326\017z\004\t<\320\201@c\330\371\254l\013S\000X\000S\000/\276\250\235\316\236`{4M\237\245\327Hj\267\310\357\361i\344\237mbA\310\355\375Wl\265\364\232\361\370\030$\235:\367d\235\252\327)\365\375A\215-\211\350\301\201\306\371\315)#\365\256 \233h\303\317s\227\223B9?\312\246\362\325\265W\352\316\320\242\"2F\3369\365\014q\035G\236;G\220\250=\376\2447\366\333\353\234X\034\273\337\336S\362\352\371?&9\205\264{\322\356\256\246cM\032\211\377\250\305 \315\370\354\221~\027Y}\276k|\014'W\301\314\267&\371H\311YR+\362s\315@\236\244?\351u$>\007\211\362}n7\202\355qV\337\263M$\250'\344\212\232\334 \216\375\346\307^9\033VN\362\367\356\256\203\372\337zl\267\261\212vw\233t\273Q\364\234\246\244\361\247\033\317_\330\\\3037\201d\333\350mIk\251A)?\336\361}%\247l\032\371Z\264\234]\354i\342\214u`\034\314s\005p\326\221q2\017\026\200Q\027\301\305\200Y\331\204\020R\250\314\"\213\310\034\233\300(\0306\327S\227\006\007\213\256\216+\003\223Q\230\305\201\002\007\333`\030\227\347\"\301\340\322\320\302A)\270:+\000X\347\332\\\030!L\001\013\007\205\n-\024\254@`~9 \254P!\006\203\313@\313\200\300\005\323\262\301\036.*\376\374\276\017+\216:j\250q\231r\212M\211&))d\0160\2068FV\017\300\312\2064i\014H\250\000\217\007\300\237\257\335A\0241\340\202\276\201r\010hA\3442vv\272=M\220\303\256\264\252b9\223\306\301a\276\270\342O\024\234\252\2353\222W!\257n\360\201j\t\032\340h\220\206\2224\0210_du\325A\356k\265\253\311T@'\002\016}\020\200\202\036;\234\327-\311\034?\372\337d\374\335\r\255\352\203o\342\322\261\r\017\314|?1D\365\\b\3464\346\306H\252\327\336F\036\177\255\260\203\030}\334\"\0022\001\340\327\237G\330\216\030\003Z\2006\213\313\313\242\222\201\357\221\016\311s\004\345!EW\273+j\023\2408\217\034\r\267\326\344\371\210[\223l\177\n\262Sj"; + PyObject *data = __Pyx_DecompressString(cstring, 648, 3); + if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) + const char* const bytes = __Pyx_PyBytes_AsString(data); + #if !CYTHON_ASSUME_SAFE_MACROS + if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } + #endif + #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (707 bytes) */ +const char* const cstring = "BZh91AY&SY\260\337\232^\000\000Z\377\363\347\377\320\210p\005\244@\255\351{\200\277\377\377`@@@@@@@@@\000@\000@\002|\003T\252\302&T<\246\2311\000\000\000\000\r\000\001\241\240\323\365A\242i\251\246\325O\321OS\365OM \320\001\240\000\000\000h\006\203\206\232db0\232`!\200M0\214\023\023!\246F\206\200i\242\002\t\221\223\022'\251\210\000\000\000\320h0\312{T\242\312\351i.\373\223\316P\246\355\333\310\336j\316\327pL\310\005C\302'\202\026\251#\365\362ea\213\226\252C\226\2402\215\351\363-\027\345\266\245'\021\242<\326\007\301kH\331\217\005\237\024[HI/\366\324tq\206<\210\003\233\266\323a\005\246\005\227\013\014\035\224\211%\rYL\364)\027\232\304\030\214=Af]B\010\321(\206\213\231\0053D\250\244\\\005\302NUcK\212\000`\"xP\370\370Ud\024m(\024\200\326\255\346\220Q\352\037ps\364a\332V\216@<\202#\252@\201u\3511\210xJ\362\004\244+[_\031\346\255\347\3161\017u\0163\303\200l\3549!\002ai1E\0141\203\202__pyx_string_tab; + Py_ssize_t pos = 0; + for (int i = 0; i < 54; i++) { + Py_ssize_t bytes_length = index[i].length; + PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL); + if (likely(string) && i >= 4) PyUnicode_InternInPlace(&string); + if (unlikely(!string)) { + Py_XDECREF(data); + __PYX_ERR(0, 1, __pyx_L1_error) + } + stringtab[i] = string; + pos += bytes_length; + } + for (int i = 54; i < 62; i++) { + Py_ssize_t bytes_length = index[i].length; + PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); + stringtab[i] = string; + pos += bytes_length; + if (unlikely(!string)) { + Py_XDECREF(data); + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + Py_XDECREF(data); + for (Py_ssize_t i = 0; i < 62; i++) { + if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = stringtab + 54; + for (Py_ssize_t i=0; i<8; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif + } return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_codeobjects ### */ -\ - typedef struct { - unsigned int argcount : 2; - unsigned int num_posonly_args : 1; - unsigned int num_kwonly_args : 1; - unsigned int nlocals : 2; - unsigned int flags : 10; - unsigned int first_line : 7; - unsigned int line_table_length : 11; - } __Pyx_PyCode_New_function_description; +typedef struct { + unsigned int argcount : 2; + unsigned int num_posonly_args : 1; + unsigned int num_kwonly_args : 1; + unsigned int nlocals : 2; + unsigned int flags : 10; + unsigned int first_line : 7; +} __Pyx_PyCode_New_function_description; /* NewCodeObj.proto */ static PyObject* __Pyx_PyCode_New( const __Pyx_PyCode_New_function_description descr, PyObject * const *varnames, PyObject *filename, PyObject *funcname, - const char *line_table, + PyObject *line_table, PyObject *tuple_dedup_map ); @@ -4536,44 +4582,44 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { PyObject* tuple_dedup_map = PyDict_New(); if (unlikely(!tuple_dedup_map)) return -1; { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4, 29}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4}; PyObject* const varnames[] = {0}; - __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_check_if_compiled, __pyx_k_1_q_s_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_check_if_compiled, __pyx_mstate->__pyx_kp_b_iso88591_1_q_s_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 30, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 30}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name}; - __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 39, 9}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 39}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; - __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_repr, __pyx_k_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_repr, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 59, 29}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 59}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; - __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_IQfA_Kq_Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_IQfA_Kq_Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 69, 31}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 69}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; - __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_resetState, __pyx_k_A_G1D_D_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_resetState, __pyx_mstate->__pyx_kp_b_iso88591_A_G1D_D_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 75, 19}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 75}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; - __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_pushState, __pyx_k_A_HG1Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_pushState, __pyx_mstate->__pyx_kp_b_iso88591_A_HG1Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 82, 58}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 82}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_diff}; - __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_popState, __pyx_k_A_t84s_Cq_1_q_HAQa_HAQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_popState, __pyx_mstate->__pyx_kp_b_iso88591_A_t84s_Cq_1_q_HAQa_HAQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 92, 26}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 92}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_hideValue, __pyx_k_A_G1F_HG1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_hideValue, __pyx_mstate->__pyx_kp_b_iso88591_A_G1F_HG1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; @@ -4586,22 +4632,32 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitGlobals(void) { /* PythonCompatibility.init */ if (likely(__Pyx_init_co_variables() == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + /* CommonTypesMetaclass.init */ + if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* CachedMethodType.init */ #if CYTHON_COMPILING_IN_LIMITED_API -{ - PyObject *typesModule=NULL; - typesModule = PyImport_ImportModule("types"); - if (typesModule) { - __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - } -} // error handling follows -#endif + { + PyObject *typesModule=NULL; + typesModule = PyImport_ImportModule("types"); + if (typesModule) { + __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + } + } // error handling follows + #endif + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + /* CythonFunctionShared.init */ + if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -4642,191 +4698,42 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { } #endif -/* PyErrExceptionMatches */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(tuple); - for (i=0; i__pyx_empty_tuple); } - for (i=0; i= 0x030C00A6 - PyObject *current_exception = tstate->current_exception; - if (unlikely(!current_exception)) return 0; - exc_type = (PyObject*) Py_TYPE(current_exception); - if (exc_type == err) return 1; -#else - exc_type = tstate->curexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; -#endif - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(exc_type); - #endif - if (unlikely(PyTuple_Check(err))) { - result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); - } else { - result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +#elif CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(exc_type); - #endif - return result; } -#endif - -/* PyErrFetchRestore */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject *tmp_value; - assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); - if (value) { - #if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) - #endif - PyException_SetTraceback(value, tb); - } - tmp_value = tstate->current_exception; - tstate->current_exception = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyObject* exc_value; - exc_value = tstate->current_exception; - tstate->current_exception = 0; - *value = exc_value; - *type = NULL; - *tb = NULL; - if (exc_value) { - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - #if CYTHON_COMPILING_IN_CPYTHON - *tb = ((PyBaseExceptionObject*) exc_value)->traceback; - Py_XINCREF(*tb); - #else - *tb = PyException_GetTraceback(exc_value); - #endif - } -#else - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#endif -} -#endif - -/* PyObjectGetAttrStr */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); - return PyObject_GetAttr(obj, attr_name); -} -#endif - -/* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 -static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) - __Pyx_PyErr_Clear(); -} -#endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { - PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - (void) PyObject_GetOptionalAttr(obj, attr_name, &result); - return result; -#else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { - return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); - } -#endif - result = __Pyx_PyObject_GetAttrStr(obj, attr_name); - if (unlikely(!result)) { - __Pyx_PyObject_GetAttrStr_ClearAttributeError(); - } - return result; -#endif -} - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); - if (unlikely(!result) && !PyErr_Occurred()) { - PyErr_Format(PyExc_NameError, - "name '%U' is not defined", name); - } - return result; -} - -/* TupleAndListFromArray */ -#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL -static CYTHON_INLINE PyObject * -__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - Py_ssize_t i; - if (n <= 0) { - return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); - } - res = PyTuple_New(n); - if (unlikely(res == NULL)) return NULL; - for (i = 0; i < n; i++) { - if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { - Py_DECREF(res); - return NULL; - } - Py_INCREF(src[i]); - } - return res; -} -#elif CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { - PyObject *v; - Py_ssize_t i; - for (i = 0; i < length; i++) { - v = dest[i] = src[i]; - Py_INCREF(v); - } -} -static CYTHON_INLINE PyObject * -__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) -{ - PyObject *res; - if (n <= 0) { - return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; @@ -4847,7 +4754,7 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) } #endif -/* BytesEquals */ +/* BytesEquals (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) @@ -4895,7 +4802,7 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq #endif } -/* UnicodeEquals */ +/* UnicodeEquals (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); @@ -5030,120 +4937,7 @@ CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, Py #endif #endif -/* RaiseDoubleKeywords */ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); -} - -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; - PyObject *kwdefs; - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { - return NULL; - } - if ( - co->co_kwonlyargcount == 0 && - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); - kwdefs = PyFunction_GET_KW_DEFAULTS(func); - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif - -/* PyObjectCall */ +/* PyObjectCall (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; @@ -5163,7 +4957,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg } #endif -/* PyObjectCallMethO */ +/* PyObjectCallMethO (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; @@ -5183,7 +4977,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject } #endif -/* PyObjectFastCall */ +/* PyObjectFastCall (used by PyObjectCallOneArg) */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; @@ -5207,7 +5001,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * con #elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { PyTypeObject *tp = Py_TYPE(callable); - #if defined(__Pyx_CyFunction_USED) + #if defined(__Pyx_CyFunction_USED) && CYTHON_METH_FASTCALL if (__Pyx_CyFunction_CheckExact(callable)) { return __Pyx_CyFunction_func_vectorcall(callable); } @@ -5238,38 +5032,16 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return __Pyx_PyObject_CallMethO(func, args[0]); } #endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); - } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); - } - } - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); - } - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); - } - #endif - #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API - vectorcallfunc f = __Pyx_PyVectorcall_Function(func); - if (f) { - return f(func, args, _nargs, NULL); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, _nargs, NULL); - } - #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL - return PyObject_Vectorcall(func, args, _nargs, NULL); + #if CYTHON_VECTORCALL + #if CYTHON_COMPILING_IN_LIMITED_API + return PyObject_Vectorcall(func, args, _nargs, NULL); + #else + vectorcallfunc f = __Pyx_PyVectorcall_Function(func); + if (f) { + return f(func, args, _nargs, NULL); + } + #endif #endif } if (nargs == 0) { @@ -5282,7 +5054,23 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } -/* UnpackUnboundCMethod */ +/* PyObjectCallOneArg (used by CallUnboundCMethod0) */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectGetAttrStr (used by UnpackUnboundCMethod) */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *result; @@ -5367,6 +5155,121 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { return 0; } +/* CallUnboundCMethod0 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + if (likely(cfunc->flag == METH_NOARGS)) + return __Pyx_CallCFunction(cfunc, self, NULL); + if (likely(cfunc->flag == METH_FASTCALL)) + return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0); + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL); + if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS))) + return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (cfunc->flag == METH_VARARGS) + return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple); + return __Pyx__CallUnboundCMethod0(cfunc, self); + } +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + else if (unlikely(was_initialized == 1)) { + __Pyx_CachedCFunction tmp_cfunc = { +#ifndef __cplusplus + 0 +#endif + }; + tmp_cfunc.type = cfunc->type; + tmp_cfunc.method_name = cfunc->method_name; + return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self); + } +#endif + PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} +#endif +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *result; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; + result = __Pyx_PyObject_CallOneArg(cfunc->method, self); + return result; +} + +/* py_dict_items (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d); +} + +/* py_dict_values (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d); +} + +/* OwnedDictNext (used by ParseKeywordsImpl) */ +#if CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) { + PyObject *next = NULL; + if (!*ppos) { + if (pvalue) { + PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p); + if (unlikely(!dictview)) goto bad; + *ppos = PyObject_GetIter(dictview); + Py_DECREF(dictview); + } else { + *ppos = PyObject_GetIter(p); + } + if (unlikely(!*ppos)) goto bad; + } + next = PyIter_Next(*ppos); + if (!next) { + if (PyErr_Occurred()) goto bad; + return 0; + } + if (pkey && pvalue) { + *pkey = __Pyx_PySequence_ITEM(next, 0); + if (unlikely(*pkey)) goto bad; + *pvalue = __Pyx_PySequence_ITEM(next, 1); + if (unlikely(*pvalue)) goto bad; + Py_DECREF(next); + } else if (pkey) { + *pkey = next; + } else { + assert(pvalue); + *pvalue = next; + } + return 1; + bad: + Py_XDECREF(next); +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 + PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef"); +#else + PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef); +#endif + if (pkey) *pkey = NULL; + if (pvalue) *pvalue = NULL; + return 0; +} +#else // !CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) { + int result = PyDict_Next(p, ppos, pkey, pvalue); + if (likely(result == 1)) { + if (pkey) Py_INCREF(*pkey); + if (pvalue) Py_INCREF(*pvalue); + } + return result; +} +#endif + +/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); +} + /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { @@ -5421,7 +5324,7 @@ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObje } } -/* ParseKeywords */ +/* ParseKeywordsImpl (used by ParseKeywords) */ static int __Pyx_ValidateDuplicatePosArgs( PyObject *kwds, PyObject ** const argnames[], @@ -5577,16 +5480,23 @@ static void __Pyx_RejectUnknownKeyword( PyObject ** const *first_kw_arg, const char *function_name) { + #if CYTHON_AVOID_BORROWED_REFS + PyObject *pos = NULL; + #else Py_ssize_t pos = 0; + #endif PyObject *key = NULL; __Pyx_BEGIN_CRITICAL_SECTION(kwds); - while (PyDict_Next(kwds, &pos, &key, NULL)) { + while ( + #if CYTHON_AVOID_BORROWED_REFS + __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL) + #else + PyDict_Next(kwds, &pos, &key, NULL) + #endif + ) { PyObject** const *name = first_kw_arg; while (*name && (**name != key)) name++; if (!*name) { - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); - #endif size_t index_found = 0; int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); if (cmp != 1) { @@ -5600,12 +5510,15 @@ static void __Pyx_RejectUnknownKeyword( #endif break; } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(key); - #endif } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif } __Pyx_END_CRITICAL_SECTION(); + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(pos); + #endif assert(PyErr_Occurred()); } static int __Pyx_ParseKeywordDict( @@ -5777,6 +5690,8 @@ static int __Pyx_ParseKeywordsTuple( #endif return -1; } + +/* ParseKeywords */ static int __Pyx_ParseKeywords( PyObject *kwds, PyObject * const *kwvalues, @@ -5908,19 +5823,14 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, return -1; } -/* PyObjectCall2Args */ +/* PyObjectCall2Args (used by PyObjectCallMethod1) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* PyObjectGetMethod */ +/* PyObjectGetMethod (used by PyObjectCallMethod1) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP @@ -6009,9 +5919,10 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me *method = attr; return 0; } +#endif -/* PyObjectCallMethod1 */ -#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) +/* PyObjectCallMethod1 (used by append) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); @@ -6019,9 +5930,8 @@ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { -#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 +#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) PyObject *args[2] = {obj, arg}; - (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); @@ -6051,14 +5961,20 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { return 0; } -/* PyObjectCallNoArg */ +/* PyObjectCallNoArg (used by PyObjectCallMethod0) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } -/* PyObjectCallMethod0 */ +/* PyObjectCallMethod0 (used by pop) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { +#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) + PyObject *args[1] = {obj}; + (void) __Pyx_PyObject_CallOneArg; + (void) __Pyx_PyObject_CallNoArg; + return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#else PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { @@ -6071,47 +5987,7 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name Py_DECREF(method); bad: return result; -} - -/* CallUnboundCMethod0 */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { - int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); - if (likely(was_initialized == 2 && cfunc->func)) { - if (likely(cfunc->flag == METH_NOARGS)) - return __Pyx_CallCFunction(cfunc, self, NULL); - if (likely(cfunc->flag == METH_FASTCALL)) - return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0); - if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) - return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL); - if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS))) - return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL); - if (cfunc->flag == METH_VARARGS) - return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple); - return __Pyx__CallUnboundCMethod0(cfunc, self); - } -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - else if (unlikely(was_initialized == 1)) { - __Pyx_CachedCFunction tmp_cfunc = { -#ifndef __cplusplus - 0 #endif - }; - tmp_cfunc.type = cfunc->type; - tmp_cfunc.method_name = cfunc->method_name; - return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self); - } -#endif - PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); - __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); - return result; -} -#endif -static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { - PyObject *result; - if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; - result = __Pyx_PyObject_CallOneArg(cfunc->method, self); - return result; } /* pop */ @@ -6193,7 +6069,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, return NULL; } -/* LimitedApiGetTypeDict */ +/* dict_setdefault (used by FetchCommonType) */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) { + PyObject* value; +#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4) + PyDict_SetDefaultRef(d, key, default_value, &value); +#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + PyObject *args[] = {d, key, default_value}; + value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#elif CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL); +#else + value = PyDict_SetDefault(d, key, default_value); + if (unlikely(!value)) return NULL; + Py_INCREF(value); +#endif + return value; +} + +/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static Py_ssize_t __Pyx_GetTypeDictOffset(void) { PyObject *tp_dictoffset_o; @@ -6229,7 +6123,7 @@ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { } #endif -/* SetItemOnTypeDict */ +/* SetItemOnTypeDict (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { int result; PyObject *tp_dict; @@ -6251,7 +6145,7 @@ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) return result; } -/* FixUpExtensionType */ +/* FixUpExtensionType (used by FetchCommonType) */ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if __PYX_LIMITED_VERSION_HEX > 0x030900B1 CYTHON_UNUSED_VAR(spec); @@ -6286,14 +6180,11 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); -#if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; -#else - type->tp_print = (printfunc) memb->offset; -#endif changed = 1; } #endif // CYTHON_METH_FASTCALL +#if !CYTHON_COMPILING_IN_PYPY else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); @@ -6308,11 +6199,13 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject } changed = 1; } +#endif // !CYTHON_COMPILING_IN_PYPY } memb++; } } #endif // !CYTHON_COMPILING_IN_LIMITED_API +#if !CYTHON_COMPILING_IN_PYPY slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_getset) slot++; @@ -6344,35 +6237,66 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject ++getset; } } +#else + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); +#endif // !CYTHON_COMPILING_IN_PYPY if (changed) PyType_Modified(type); #endif // PY_VERSION_HEX > 0x030900B1 return 0; } -/* FetchSharedCythonModule */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); -} - -/* dict_setdefault */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, - int is_safe_type) { - PyObject* value; - CYTHON_MAYBE_UNUSED_VAR(is_safe_type); -#if CYTHON_COMPILING_IN_LIMITED_API - value = PyObject_CallMethod(d, "setdefault", "OO", key, default_value); -#elif PY_VERSION_HEX >= 0x030d0000 - PyDict_SetDefaultRef(d, key, default_value, &value); +/* AddModuleRef (used by FetchSharedCythonModule) */ +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) { + PyObject *module_dict = PyImport_GetModuleDict(); + PyObject *m; + if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) { + return NULL; + } + if (m != NULL && PyModule_Check(m)) { + return m; + } + Py_XDECREF(m); + m = PyModule_NewObject(name); + if (m == NULL) + return NULL; + if (PyDict_CheckExact(module_dict)) { + PyObject *new_m; + (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m); + Py_DECREF(m); + return new_m; + } else { + if (PyObject_SetItem(module_dict, name, m) != 0) { + Py_DECREF(m); + return NULL; + } + return m; + } + } + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *py_name = PyUnicode_FromString(name); + if (!py_name) return NULL; + PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name); + Py_DECREF(py_name); + return module; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else - value = PyDict_SetDefault(d, key, default_value); - if (unlikely(!value)) return NULL; - Py_INCREF(value); + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } #endif - return value; + +/* FetchSharedCythonModule (used by FetchCommonType) */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); } -/* FetchCommonType */ +/* FetchCommonType (used by CommonTypesMetaclass) */ #if __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases); @@ -6445,11 +6369,13 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyOb } else if (unlikely(get_item_ref_result == -1)) { goto bad; } - CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromMetaclass(metaclass, abi_module, spec, bases); + cached_type = __Pyx_PyType_FromMetaclass( + metaclass, + CYTHON_USE_MODULE_STATE ? module : abi_module, + spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; - new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1); + new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type); if (unlikely(new_cached_type != cached_type)) { if (unlikely(!new_cached_type)) goto bad; Py_DECREF(cached_type); @@ -6475,26 +6401,39 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyOb goto done; } -/* CommonTypesMetaclass */ -PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { +/* CommonTypesMetaclass (used by CythonFunctionShared) */ +static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); } +#if __PYX_LIMITED_VERSION_HEX < 0x030A0000 +static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) { + PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types"); + return NULL; +} +static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) { + PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable"); + return -1; +} +#endif static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = { {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL}, {0, 0, 0, 0, 0} }; static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = { {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset}, + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call}, + {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call}, + {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr}, + #endif {0, 0} }; static PyType_Spec __pyx_CommonTypesMetaclass_spec = { __PYX_TYPE_MODULE_PREFIX "_common_types_metatype", 0, 0, -#if PY_VERSION_HEX >= 0x030A0000 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | -#endif Py_TPFLAGS_DEFAULT, __pyx_CommonTypesMetaclass_slots }; @@ -6505,13 +6444,14 @@ static int __pyx_CommonTypesMetaclass_init(PyObject *module) { return -1; } mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); + Py_DECREF(bases); if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { return -1; } return 0; } -/* CallTypeTraverse */ +/* CallTypeTraverse (used by CythonFunctionShared) */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) { @@ -6530,7 +6470,7 @@ static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visi } #endif -/* PyMethodNew */ +/* PyMethodNew (used by CythonFunctionShared) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *result; @@ -6556,15 +6496,20 @@ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *ty } #endif -/* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +/* PyVectorcallFastCallDict (used by CythonFunctionShared) */ +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; - Py_ssize_t i, pos; + Py_ssize_t i; + #if CYTHON_AVOID_BORROWED_REFS + PyObject *pos; + #else + Py_ssize_t pos; + #endif size_t j; PyObject *key, *value; unsigned long keys_are_strings; @@ -6586,17 +6531,16 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector return NULL; } kwvalues = newargs + nargs; - pos = i = 0; + pos = 0; + i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; - while (PyDict_Next(kw, &pos, &key, &value)) { + while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) { keys_are_strings &= #if CYTHON_COMPILING_IN_LIMITED_API PyType_GetFlags(Py_TYPE(key)); #else Py_TYPE(key)->tp_flags; #endif - Py_INCREF(key); - Py_INCREF(value); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; #else @@ -6611,6 +6555,9 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } res = vc(func, newargs, nargs, kwnames); cleanup: + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(pos); + #endif Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); @@ -6639,7 +6586,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ } #endif -/* CythonFunctionShared */ +/* CythonFunctionShared (used by CythonFunction) */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { if (__Pyx_CyFunction_Check(func)) { @@ -6791,9 +6738,11 @@ __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void __Pyx_END_CRITICAL_SECTION(); return 0; } +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject * -__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) @@ -6802,36 +6751,7 @@ __Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) Py_INCREF(op->func_dict); return op->func_dict; } -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - PyObject *result; - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_dict_locked(op); - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - Py_INCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->func_dict, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; -} +#endif static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { @@ -6959,6 +6879,7 @@ __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { __Pyx_END_CRITICAL_SECTION(); return result; } +static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value); static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -6973,8 +6894,54 @@ __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, vo __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_annotations, value); __Pyx_END_CRITICAL_SECTION(); + if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists((PyObject*) op, Py_None) < 0)) return -1; return 0; } +static int +__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) { + /* Return 1 if the function dict exists, 0 otherwise. This cannot fail: + * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */ +#if CYTHON_COMPILING_IN_PYPY + *dict = PyObject_GenericGetDict(op_in, NULL); +#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000 + *dict = ((__pyx_CyFunctionObject*) op_in)->func_dict; +#else + PyObject **dictptr = _PyObject_GetDictPtr(op_in); + *dict = likely(dictptr) ? *dictptr : NULL; +#endif + return *dict ? 1 : 0; +} +static int +__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) { + PyObject *dict; + int dict_found; + *annotate = NULL; + dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict); + if (!dict_found) return 0; + return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate); +} +static int +__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) { + PyObject *dict; + int dict_found; + dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict); + if (!dict_found) return 0; + return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value); +} +static int +__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) { + PyObject *dict; + int result; +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + dict = __Pyx_CyFunction_get_dict((__pyx_CyFunctionObject*) op_in, NULL); +#else + dict = PyObject_GenericGetDict(op_in, NULL); +#endif + if (unlikely(!dict)) return -1; + result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value); + Py_DECREF(dict); + return result; +} static PyObject * __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; @@ -6987,14 +6954,88 @@ __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { return result; } static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { - PyObject *result; +__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) { + PyObject *annotate = NULL; + PyObject *result = NULL; + __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in; CYTHON_UNUSED_VAR(context); - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + result = __Pyx_XNewRef(op->func_annotations); + __Pyx_END_CRITICAL_SECTION(); + if (result) return result; + if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL; + if (!annotate || annotate == Py_None) { + Py_XDECREF(annotate); + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; + } + PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE + if (likely(format)) { + result = __Pyx_PyObject_CallOneArg(annotate, format); + Py_DECREF(format); + } + Py_DECREF(annotate); + if (unlikely(!result)) return NULL; + if (unlikely(!PyDict_Check(result))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict"); + Py_DECREF(result); + return NULL; + } + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result)); __Pyx_END_CRITICAL_SECTION(); return result; } +static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *args) { + CYTHON_UNUSED_VAR(args); + if (unlikely(!self)) { + PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument"); + } + Py_XINCREF(self); + return self; +} +static PyMethodDef __Pyx_CyFunction_annotate_method = { + "__annotate__", + (PyCFunction)(void (*)(void))__Pyx_CyFunction_annotate_impl, + METH_VARARGS, + "Placeholder __annotate__ function to allow 'functools.wraps' to work " + "on Cython functions." +}; +static PyObject * +__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) { + PyObject *annotate = NULL; + CYTHON_UNUSED_VAR(context); + if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL; + if (annotate) return annotate; + PyObject *annotations = __Pyx_CyFunction_get_annotations(op_in, NULL); + if (unlikely(!annotations)) return NULL; + PyObject *method = PyCFunction_New( + &__Pyx_CyFunction_annotate_method, + annotations); + Py_DECREF(annotations); + return method; +} +static int +__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted"); + return -1; + } + if (unlikely(value != Py_None && !PyCallable_Check(value))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None"); + return -1; + } + if (value != Py_None) { + __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in; + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + Py_CLEAR(op->func_annotations); + __Pyx_END_CRITICAL_SECTION(); + } + return __Pyx_CyFunction_set_annotate_in_dict(op_in, value); +} static PyObject * __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; @@ -7007,7 +7048,6 @@ __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { - Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } @@ -7093,8 +7133,13 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, + {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, +#else + {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, + {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, +#endif {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, @@ -7105,6 +7150,7 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0}, {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, @@ -7115,9 +7161,11 @@ static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#endif #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, @@ -7173,7 +7221,9 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_XINCREF(module); cf->m_module = module; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API op->func_dict = NULL; +#endif op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; @@ -7227,14 +7277,19 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func_dict); +#elif PY_VERSION_HEX < 0x030d0000 + _PyObject_ClearManagedDict((PyObject*)m); +#else + PyObject_ClearManagedDict((PyObject*)m); +#endif Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { @@ -7242,7 +7297,6 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } -#endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); @@ -7275,17 +7329,29 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func_dict); +#else + { + int e = +#if PY_VERSION_HEX < 0x030d0000 + _PyObject_VisitManagedDict +#else + PyObject_VisitManagedDict +#endif + ((PyObject*)m, visit, arg); + if (e != 0) return e; + } +#endif __Pyx_VISIT_CONST(m->func_name); __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); __Pyx_VISIT_CONST(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); -#endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_annotations); Py_VISIT(m->func_is_coroutine); Py_VISIT(m->defaults); return 0; @@ -7387,7 +7453,7 @@ static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *a static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE @@ -7426,7 +7492,7 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; @@ -7448,11 +7514,7 @@ static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionO static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -7487,11 +7549,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -7526,11 +7584,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -7561,11 +7615,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -7590,7 +7640,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); + #if PY_VERSION_HEX < 0x030e00A6 + size_t nargs_value = (size_t) nargs; + #else + Py_ssize_t nargs_value = nargs; + #endif + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames); } #endif static PyType_Slot __pyx_CyFunctionType_slots[] = { @@ -7619,9 +7674,10 @@ static PyType_Spec __pyx_CyFunctionType_spec = { _Py_TPFLAGS_HAVE_VECTORCALL | #endif #endif // CYTHON_METH_FASTCALL -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | +#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_TPFLAGS_MANAGED_DICT | #endif + Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; @@ -7670,7 +7726,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual return op; } -/* CalculateMetaclass */ +/* CalculateMetaclass (used by Py3ClassCreate) */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_SIZE @@ -7712,7 +7768,136 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas return (PyObject*) metaclass; } -/* PyObjectLookupSpecial */ +/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStrNoError (used by Py3ClassCreate) */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} + +/* PyObjectLookupSpecial (used by Py3ClassCreate) */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; @@ -7788,7 +7973,17 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj return result; } -/* PyDictVersioning */ +/* GetBuiltinName (used by GetModuleGlobalName) */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, + "name '%U' is not defined", name); + } + return result; +} + +/* PyDictVersioning (used by GetModuleGlobalName) */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; @@ -7953,55 +8148,44 @@ __Pyx_PEP560_update_bases(PyObject *bases) return NULL; } -/* CLineInTraceback */ +/* CLineInTraceback (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o)) +#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL); +#else +PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) { + PyObject **dict_ptr = _PyObject_GetDictPtr(o); + return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL; +} +#endif static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { - PyObject *use_cline; + PyObject *use_cline = NULL; PyObject *ptype, *pvalue, *ptraceback; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject **cython_runtime_dict; -#endif + PyObject *cython_runtime_dict; CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); -#if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); + cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { - __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict); __PYX_PY_DICT_LOOKUP_IF_MODIFIED( - use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) - Py_XINCREF(use_cline); - __Pyx_END_CRITICAL_SECTION(); - } else -#endif - { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); - if (use_cline_obj) { - use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; - Py_INCREF(use_cline); - Py_DECREF(use_cline_obj); - } else { - PyErr_Clear(); - use_cline = NULL; - } - } - if (!use_cline) { - c_line = 0; - (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); + use_cline, cython_runtime_dict, + __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False)) } - else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } Py_XDECREF(use_cline); + Py_XDECREF(cython_runtime_dict); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif -/* CodeObjectCache */ +/* CodeObjectCache (used by AddTraceback) */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -8153,8 +8337,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { - (void) __pyx_cfilenm; - (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = __pyx_find_code_object(c_line ? -c_line : py_line); @@ -8163,7 +8346,11 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); + if (c_line) { + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + } else { + py_funcname = PyUnicode_FromString(funcname); + } if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; @@ -8294,12 +8481,12 @@ __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) } #endif -/* PyObjectVectorCallKwBuilder */ +/* PyObjectVectorCallKwBuilder (used by CIntToPy) */ #if CYTHON_VECTORCALL static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { (void)__Pyx_PyObject_FastCallDict; - if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; Py_INCREF(key); + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; args[n] = value; return 0; } @@ -8342,7 +8529,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif @@ -8350,10 +8537,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { } else { if (sizeof(long) <= sizeof(long)) { return PyLong_FromLong((long) value); -#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif } } { @@ -8397,7 +8582,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { } } -/* CIntFromPyVerify */ +/* CIntFromPyVerify (used by CIntFromPy) */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ @@ -8493,10 +8678,8 @@ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -8565,10 +8748,8 @@ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif } } { @@ -8747,10 +8928,8 @@ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -8819,10 +8998,8 @@ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif } } { @@ -9015,11 +9192,8 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #endif /* GetRuntimeVersion */ -static unsigned long __Pyx_get_runtime_version(void) { -#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 - return Py_Version & ~0xFFUL; -#else - static unsigned long __Pyx_cached_runtime_version = 0; +#if __PYX_LIMITED_VERSION_HEX < 0x030b0000 +void __Pyx_init_runtime_version(void) { if (__Pyx_cached_runtime_version == 0) { const char* rt_version = Py_GetVersion(); unsigned long version = 0; @@ -9040,6 +9214,12 @@ static unsigned long __Pyx_get_runtime_version(void) { } __Pyx_cached_runtime_version = version; } +} +#endif +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + return Py_Version & ~0xFFUL; +#else return __Pyx_cached_runtime_version; #endif } @@ -9127,9 +9307,13 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1 + if (likely(result)) + result->_co_firsttraceable = 0; + #endif return result; } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY +#elif !CYTHON_COMPILING_IN_PYPY #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else @@ -9141,10 +9325,10 @@ static PyObject* __Pyx_PyCode_New( PyObject * const *varnames, PyObject *filename, PyObject *funcname, - const char *line_table, + PyObject *line_table, PyObject *tuple_dedup_map ) { - PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL; + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL; Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; PyObject *varnames_tuple = PyTuple_New(var_count); if (unlikely(!varnames_tuple)) return NULL; @@ -9165,11 +9349,12 @@ static PyObject* __Pyx_PyCode_New( #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(varnames_tuple_dedup); #endif - if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL - && !CYTHON_COMPILING_IN_GRAAL) { - line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length); - if (unlikely(!line_table_bytes)) goto done; - Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3; + if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) { + Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(line_table_length == -1)) goto done; + #endif + Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL; code_bytes = PyBytes_FromStringAndSize(NULL, code_len); if (unlikely(!code_bytes)) goto done; char* c_code_bytes = PyBytes_AsString(code_bytes); @@ -9192,11 +9377,10 @@ static PyObject* __Pyx_PyCode_New( filename, funcname, (int) descr.first_line, - (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes ); done: Py_XDECREF(code_bytes); - Py_XDECREF(line_table_bytes); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(varnames_tuple_dedup); #endif @@ -9204,30 +9388,68 @@ static PyObject* __Pyx_PyCode_New( return code_obj; } -/* InitStrings */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { - while (t->s) { - PyObject *str; - if (t->is_unicode) { - if (t->intern) { - str = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); - } else { - str = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - str = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - if (!str) - return -1; - *target = str; - if (PyObject_Hash(str) == -1) - return -1; - ++t; - ++target; +/* DecompressString */ +static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) { + PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed; + const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib"; + PyObject *methodname = PyUnicode_FromString("decompress"); + if (unlikely(!methodname)) return NULL; + #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000 + if (algo == 3) { + PyObject *fromlist = Py_BuildValue("[O]", methodname); + if (unlikely(!fromlist)) goto bad; + module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + } else + #endif + module = PyImport_ImportModule(module_name); + if (unlikely(!module)) goto import_failed; + decompress = PyObject_GetAttr(module, methodname); + if (unlikely(!decompress)) goto import_failed; + { + #ifdef __cplusplus + char *memview_bytes = const_cast(s); + #else + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wcast-qual" + #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-qual" + #endif + char *memview_bytes = (char*) s; + #if defined(__clang__) + #pragma clang diagnostic pop + #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) + #pragma GCC diagnostic pop + #endif + #endif + #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ) + int memview_flags = 0x100; + #else + int memview_flags = PyBUF_READ; + #endif + compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags); } - return 0; + if (unlikely(!compressed_bytes)) { + Py_DECREF(decompress); + goto bad; + } + decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL); + Py_DECREF(compressed_bytes); + Py_DECREF(decompress); + Py_DECREF(module); + Py_DECREF(methodname); + return decompressed; +import_failed: + PyErr_Format(PyExc_ImportError, + "Failed to import '%.20s.decompress' - cannot initialise module strings. " + "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.", + module_name, algo); +bad: + Py_XDECREF(module); + Py_DECREF(methodname); + return NULL; } #include @@ -9449,7 +9671,7 @@ static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { return __Pyx_NewRef(Py_None); } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { - return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); + return __Pyx_NewRef(b ? Py_True: Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { return PyLong_FromSize_t(ival); diff --git a/constraint/parser.c b/constraint/parser.c index b2e2d74..6f2d79c 100644 --- a/constraint/parser.c +++ b/constraint/parser.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.2 */ +/* Generated by Cython 3.2.9 */ /* BEGIN: Cython Metadata { @@ -19,8 +19,16 @@ END: Cython Metadata */ #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ /* InitLimitedAPI */ -#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) +#if defined(Py_LIMITED_API) + #if !defined(CYTHON_LIMITED_API) #define CYTHON_LIMITED_API 1 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef _MSC_VER + #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.") + #else + #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead. + #endif #endif #include "Python.h" @@ -29,8 +37,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_1_2" -#define CYTHON_HEX_VERSION 0x030102F0 +#define __PYX_ABI_VERSION "3_2_9" +#define CYTHON_HEX_VERSION 0x030209F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -55,9 +63,6 @@ END: Cython Metadata */ #define DL_EXPORT(t) t #endif #define __PYX_COMMA , -#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -#endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif @@ -90,7 +95,7 @@ END: Cython Metadata */ #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_ASSUME_SAFE_SIZE @@ -127,6 +132,8 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 @@ -194,6 +201,8 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX @@ -204,8 +213,6 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 - #undef CYTHON_CLINE_IN_TRACEBACK - #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS @@ -265,8 +272,11 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #ifndef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 1 + #endif + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 @@ -373,6 +383,15 @@ END: Cython Metadata */ #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif + #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work + #elif !defined(CYTHON_IMMORTAL_CONSTANTS) + #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) + #endif +#endif +#ifndef CYTHON_COMPRESS_STRINGS + #define CYTHON_COMPRESS_STRINGS 1 #endif #ifndef CYTHON_FAST_PYCCALL #define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL @@ -381,10 +400,9 @@ END: Cython Metadata */ #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #else -#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL) #endif #endif -#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #undef SHIFT #undef BASE @@ -460,35 +478,8 @@ END: Cython Metadata */ #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; - #endif - #endif - #if _MSC_VER < 1300 - #ifdef _WIN64 - typedef unsigned long long __pyx_uintptr_t; - #else - typedef unsigned int __pyx_uintptr_t; - #endif - #else - #ifdef _WIN64 - typedef unsigned __int64 __pyx_uintptr_t; - #else - typedef unsigned __int32 __pyx_uintptr_t; - #endif - #endif -#else - #include - typedef uintptr_t __pyx_uintptr_t; -#endif +#include +typedef uintptr_t __pyx_uintptr_t; #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 @@ -531,9 +522,9 @@ END: Cython Metadata */ #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000) #else - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) @@ -637,6 +628,12 @@ static int __Pyx_init_co_variables(void); #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif +#ifndef Py_TPFLAGS_IMMUTABLETYPE + #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8) +#endif +#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION + #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7) +#endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif @@ -669,11 +666,6 @@ static int __Pyx_init_co_variables(void); #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) -#elif CYTHON_BACKPORT_VECTORCALL - typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) @@ -703,7 +695,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(vo #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x03090000 +#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000) #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else @@ -720,6 +712,9 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(vo #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno)) #elif CYTHON_COMPILING_IN_GRAAL #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) @@ -810,7 +805,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #endif #define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) -#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#if CYTHON_USE_TYPE_SPECS #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ @@ -874,7 +869,10 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #endif #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else @@ -890,22 +888,55 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif -#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) - #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS +enum __Pyx_ReferenceSharing { + __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check + __Pyx_ReferenceSharing_OwnStrongReference, + __Pyx_ReferenceSharing_FunctionArgument, + __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar +}; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000 +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\ + (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\ + (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\ + (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0))) +#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1) +#else +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) #else #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i) #endif -#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS - #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE) + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) +#else + #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\ + __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +#endif +#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_PyList_GetItemRef(o, i)) +#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\ + __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ + __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i)) #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\ + __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ + __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i)) #endif +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_NewRef(PyList_GET_ITEM(o, i))) #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_XNewRef(PyList_GetItem(o, i))) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) @@ -966,15 +997,6 @@ static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) -#else - static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { - PyObject *module = PyImport_AddModule(name); - Py_XINCREF(module); - return module; - } -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif @@ -1081,15 +1103,6 @@ static int __Pyx_init_co_variables(void) { #endif #endif #include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else @@ -1138,6 +1151,15 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif +#ifdef CYTHON_FREETHREADING_COMPATIBLE +#if CYTHON_FREETHREADING_COMPATIBLE +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED +#else +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED +#endif +#else +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED +#endif #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING "" @@ -1340,7 +1362,7 @@ static const char* const __pyx_f[] = { "constraint/parser.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* Atomics.proto */ +/* Atomics.proto (used by UnpackUnboundCMethod) */ #include #ifndef CYTHON_ATOMICS #define CYTHON_ATOMICS 1 @@ -1376,6 +1398,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C atomics") #elif defined(__PYX_DEBUG_ATOMICS) @@ -1400,6 +1423,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C++ atomics") #elif defined(__PYX_DEBUG_ATOMICS) @@ -1409,6 +1433,7 @@ static const char* const __pyx_f[] = { (__GNUC_MINOR__ > 1 ||\ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) #define __pyx_atomic_ptr_type void* + #define __pyx_nonatomic_ptr_type void* #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1) @@ -1424,6 +1449,12 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value) + static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { + __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } #ifdef __PYX_DEBUG_ATOMICS #warning "Using GNU atomics" #endif @@ -1434,6 +1465,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_ptr_type void* #undef __pyx_nonatomic_int_type #define __pyx_nonatomic_int_type long + #define __pyx_nonatomic_ptr_type void* #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer) #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1) #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1) @@ -1450,6 +1482,12 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0) #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value) + static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { + __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } #ifdef __PYX_DEBUG_ATOMICS #pragma message ("Using MSVC atomics") #endif @@ -1460,36 +1498,27 @@ static const char* const __pyx_f[] = { #warning "Not using atomics" #endif #endif -#if CYTHON_ATOMICS - #define __pyx_add_acquisition_count(memview)\ - __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview)) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview)) -#else - #define __pyx_add_acquisition_count(memview)\ - __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) -#endif - -/* IncludeStructmemberH.proto */ -#include -/* CriticalSections.proto */ +/* CriticalSectionsDefinition.proto (used by CriticalSections) */ #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __Pyx_PyCriticalSection void* #define __Pyx_PyCriticalSection2 void* -#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs -#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs -#define __Pyx_PyCriticalSection_End1(cs) -#define __Pyx_PyCriticalSection_End2(cs) +#define __Pyx_PyCriticalSection_End(cs) +#define __Pyx_PyCriticalSection2_End(cs) #else #define __Pyx_PyCriticalSection PyCriticalSection #define __Pyx_PyCriticalSection2 PyCriticalSection2 -#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin -#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin -#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End -#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End +#define __Pyx_PyCriticalSection_End PyCriticalSection_End +#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End +#endif + +/* CriticalSections.proto (used by ParseKeywordsImpl) */ +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs) +#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs) +#else +#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin +#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin #endif #if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_BEGIN_CRITICAL_SECTION(o) { @@ -1499,6 +1528,9 @@ static const char* const __pyx_f[] = { #define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif +/* IncludeStructmemberH.proto (used by FixUpExtensionType) */ +#include + /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ @@ -1515,15 +1547,16 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr; -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint; -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr; +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr; +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr; +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr; -/* "constraint/parser.py":30 - * ) +/* "constraint/parser.py":32 + * * - * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< - * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 + * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Constraint | str, list[str]]]: # <<<<<<<<<<<<<< + * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 * # rewrite the restrictions so variables are singled out */ struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions { @@ -1535,12 +1568,12 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions { }; -/* "constraint/parser.py":79 +/* "constraint/parser.py":81 * return split_restrictions * - * def to_numeric_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]: # noqa: E501 + * def to_numeric_constraint(restriction: str, params: list[str]) -> MinSumConstraint | VariableMinSumConstraint | ExactSumConstraint | VariableExactSumConstraint | MaxSumConstraint | VariableMaxSumConstraint | MinProdConstraint | VariableMinProdConstraint | ExactProdConstraint | VariableExactProdConstraint | MaxProdConstraint | VariableMaxProdConstraint | None: # noqa: E501 # <<<<<<<<<<<<<< + * """Converts a restriction to a built-in numeric constraint if possible.""" + * # first check if all parameters have only numbers as values */ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint { PyObject_HEAD @@ -1594,8 +1627,8 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr { * * # we have a potentially rewritten restriction, split again * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< - * operators_left = [s.strip() for s in list(left) if s in supported_operators] - * operators_right = [s.strip() for s in list(right) if s in supported_operators] + * operators_left = extract_operators(left) + * operators_right = extract_operators(right) */ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr { PyObject_HEAD @@ -1607,14 +1640,29 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr { }; -/* "constraint/parser.py":168 +/* "constraint/parser.py":160 + * if len(variables) == 0: + * return None + * if any(var.strip() not in tune_params for var in variables): # <<<<<<<<<<<<<< + * raise ValueError(f"Variables {variables} not in tune_params {tune_params.keys()}") + * if ( +*/ +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { + PyObject_HEAD + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_outer_scope; + PyObject *__pyx_genexpr_arg_0; + PyObject *__pyx_v_var; +}; + + +/* "constraint/parser.py":169 * * # find all unique variable_supported_operators in the restriction, can have at most one * variable_operators_left = list(s.strip() for s in list(left) if s in variable_supported_operators) # <<<<<<<<<<<<<< * variable_operators_right = list(s.strip() for s in list(right) if s in variable_supported_operators) * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; @@ -1622,14 +1670,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { }; -/* "constraint/parser.py":169 +/* "constraint/parser.py":170 * # find all unique variable_supported_operators in the restriction, can have at most one * variable_operators_left = list(s.strip() for s in list(left) if s in variable_supported_operators) * variable_operators_right = list(s.strip() for s in list(right) if s in variable_supported_operators) # <<<<<<<<<<<<<< * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; @@ -1637,14 +1685,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { }; -/* "constraint/parser.py":172 - * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) - * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - * if len(variable_unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0): # noqa: E501 # <<<<<<<<<<<<<< - * variables_on_left = len(unique_operators_left) > 0 - * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": +/* "constraint/parser.py":175 + * if ( + * len(variable_unique_operators) <= 1 + * and all(s.strip() in params for s in variables) # <<<<<<<<<<<<<< + * and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0) + * ): # noqa: E501 */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; @@ -1652,14 +1700,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr { }; -/* "constraint/parser.py":238 +/* "constraint/parser.py":267 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< * # if there is a mix of operators (e.g. 'x + y * z == 3'), return None * return None */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; @@ -1667,14 +1715,14 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr { }; -/* "constraint/parser.py":245 +/* "constraint/parser.py":274 * splitted = variables.split(operator) * # check if there are only pure, non-recurring variables (no operations or constants) in the restriction * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< * # map to a Constraint * if operator == "**": */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; @@ -1682,43 +1730,43 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr { }; -/* "constraint/parser.py":269 +/* "constraint/parser.py":298 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: + * ) -> AllEqualConstraint | AllDifferentConstraint | None: */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_outer_scope; PyObject *__pyx_v_params; }; -/* "constraint/parser.py":288 +/* "constraint/parser.py":317 * splitted = restriction.split(comparator) * # check if there are only pure, non-recurring variables (no operations or constants) in the restriction * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< * # map to a Constraint * if comparator == "==": */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr { PyObject_HEAD - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *__pyx_outer_scope; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_s; }; -/* "constraint/parser.py":298 +/* "constraint/parser.py":327 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< * # clean the restriction strings to functional equivalence - * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] + * restrictions_cleaned = [r.replace(" ", "") for r in restrictions] */ -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr { +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_r; @@ -1800,7 +1848,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr { #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) -/* PyErrExceptionMatches.proto */ +/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); @@ -1808,7 +1856,7 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif -/* PyThreadStateGet.proto */ +/* PyThreadStateGet.proto (used by PyErrFetchRestore) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; @@ -1826,7 +1874,7 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif -/* PyErrFetchRestore.proto */ +/* PyErrFetchRestore.proto (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) @@ -1851,20 +1899,20 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif -/* PyObjectGetAttrStr.proto */ +/* PyObjectGetAttrStr.proto (used by PyObjectGetAttrStrNoError) */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif -/* PyObjectGetAttrStrNoError.proto */ +/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); -/* TupleAndListFromArray.proto */ +/* TupleAndListFromArray.proto (used by fastcall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1872,13 +1920,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_s static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif -/* IncludeStringH.proto */ +/* IncludeStringH.proto (used by BytesEquals) */ #include -/* BytesEquals.proto */ +/* BytesEquals.proto (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); -/* UnicodeEquals.proto */ +/* UnicodeEquals.proto (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ @@ -1911,25 +1959,16 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #endif #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) -#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#if CYTHON_METH_FASTCALL #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start) #else -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS #endif -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static CYTHON_INLINE int __Pyx_ParseKeywords( - PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], - PyObject *kwds2, PyObject *values[], - Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, - const char* function_name, - int ignore_unknown_kwargs -); +/* py_dict_items.proto (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); -/* CallCFunction.proto */ +/* CallCFunction.proto (used by CallUnboundCMethod0) */ #define __Pyx_CallCFunction(cfunc, self, args)\ ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) #define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ @@ -1939,52 +1978,26 @@ static CYTHON_INLINE int __Pyx_ParseKeywords( #define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\ ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames) -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#if !CYTHON_VECTORCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs); -#endif -#define __Pyx_BUILD_ASSERT_EXPR(cond)\ - (sizeof(char [1 - 2*!(cond)]) - 1) -#ifndef Py_MEMBER_SIZE -#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) -#endif -#if !CYTHON_VECTORCALL -#if PY_VERSION_HEX >= 0x03080000 - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets() - #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) -#else - static size_t __pyx_pyframe_localsplus_offset = 0; - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets()\ - ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ - (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) - #define __Pyx_PyFrame_GetLocalsplus(frame)\ - (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) -#endif -#endif -#endif - -/* PyObjectCall.proto */ +/* PyObjectCall.proto (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif -/* PyObjectCallMethO.proto */ +/* PyObjectCallMethO.proto (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif -/* PyObjectFastCall.proto */ +/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); -/* UnpackUnboundCMethod.proto */ +/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */ typedef struct { PyObject *type; PyObject **method_name; @@ -2017,6 +2030,59 @@ static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_Ca #define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) #endif +/* CallUnboundCMethod0.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + +/* py_dict_values.proto (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); + +/* OwnedDictNext.proto (used by ParseKeywordsImpl) */ +#if CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue); +#else +CYTHON_INLINE +static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue); +#endif + +/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywordsImpl.export */ +static int __Pyx_ParseKeywordsTuple( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name +); +static int __Pyx_ParseKeywordDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + /* CallUnboundCMethod2.proto */ CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); @@ -2026,15 +2092,26 @@ static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction * #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif +/* ParseKeywords.proto */ +static CYTHON_INLINE int __Pyx_ParseKeywords( + PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], + PyObject *kwds2, PyObject *values[], + Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); +/* ArgTypeTestFunc.export */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyObjectFastCallMethod.proto */ #if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 @@ -2059,20 +2136,37 @@ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, /* UnicodeConcatInPlace.proto */ # if CYTHON_COMPILING_IN_CPYTHON #if CYTHON_REFNANNY - #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) + #define __Pyx_PyUnicode_ConcatInPlace(left, right, unsafe_shared) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, unsafe_shared, __pyx_refnanny) #else - #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right) + #define __Pyx_PyUnicode_ConcatInPlace(left, right, unsafe_shared) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, unsafe_shared) #endif - static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right + #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_DefinitelyUnique) + #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_OwnStrongReference) + #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_FunctionArgument) + #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_SharedReference) + static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right, int unsafe_shared #if CYTHON_REFNANNY , void* __pyx_refnanny #endif ); #else -#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat -#endif -#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ - PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace __Pyx_PyUnicode_Concat +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace __Pyx_PyUnicode_Concat +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace __Pyx_PyUnicode_Concat +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace __Pyx_PyUnicode_Concat +#endif +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlaceSafe(left, right)\ + ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace(left, right)) +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(left, right)\ + ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(left, right)) +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlaceSafe(left, right)\ + ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace(left, right)) +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlaceSafe(left, right)\ + ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace(left, right)) /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { @@ -2101,7 +2195,7 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif -/* PyDictVersioning.proto */ +/* PyDictVersioning.proto (used by GetModuleGlobalName) */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) @@ -2112,7 +2206,7 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ + (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ @@ -2169,6 +2263,11 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif +/* PyRange_Check.proto */ +#if CYTHON_COMPILING_IN_PYPY && !defined(PyRange_Check) + #define PyRange_Check(obj) __Pyx_TypeCheck((obj), &PyRange_Type) +#endif + /* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); @@ -2186,29 +2285,26 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject #endif /* GetItemInt.proto */ -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ + int wraparound, int boundscheck, int unsafe_shared); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); + int wraparound, int boundscheck, int unsafe_shared); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + int is_list, int wraparound, int boundscheck, int unsafe_shared); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS @@ -2223,57 +2319,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); -/* AssertionsEnabled.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) - static int __pyx_assertions_enabled_flag; - #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) - static int __Pyx_init_assertions_enabled(void) { - PyObject *builtins, *debug, *debug_str; - int flag; - builtins = PyEval_GetBuiltins(); - if (!builtins) goto bad; - debug_str = PyUnicode_FromStringAndSize("__debug__", 9); - if (!debug_str) goto bad; - debug = PyObject_GetItem(builtins, debug_str); - Py_DECREF(debug_str); - if (!debug) goto bad; - flag = PyObject_IsTrue(debug); - Py_DECREF(debug); - if (flag == -1) goto bad; - __pyx_assertions_enabled_flag = flag; - return 0; - bad: - __pyx_assertions_enabled_flag = 1; - return -1; - } -#else - #define __Pyx_init_assertions_enabled() (0) - #define __pyx_assertions_enabled() (!Py_OptimizeFlag) -#endif - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* GetTopmostException.proto */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); -#endif - -/* SaveResetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -#else -#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) -#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) -#endif - /* RaiseUnboundLocalError.proto */ static void __Pyx_RaiseUnboundLocalError(const char *varname); -/* GetException.proto */ +/* GetException.proto (used by pep479) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); @@ -2301,7 +2350,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -/* PyObjectCall2Args.proto */ +/* PyObjectCall2Args.proto (used by CallUnboundCMethod1) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* CallUnboundCMethod1.proto */ @@ -2313,10 +2362,10 @@ static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) #endif -/* PyObjectCallNoArg.proto */ +/* PyObjectCallNoArg.proto (used by pyfrozenset_new) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); -/* pyfrozenset_new.proto */ +/* pyfrozenset_new.proto (used by PySetContains) */ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); /* PySetContains.proto */ @@ -2339,51 +2388,71 @@ static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, in PyObject_Format(s, f)) #endif -/* JoinPyUnicode.proto */ +/* JoinPyUnicode.export */ static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); -/* LimitedApiGetTypeDict.proto */ +/* PyValueError_Check.proto */ +#define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError) + +/* py_dict_keys.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); + +/* RaiseException.export */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* RaiseNoneIterError.proto */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); + +/* dict_setdefault.proto (used by FetchCommonType) */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value); + +/* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); #endif -/* SetItemOnTypeDict.proto */ +/* SetItemOnTypeDict.proto (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v); #define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v) -/* FixUpExtensionType.proto */ +/* FixUpExtensionType.proto (used by FetchCommonType) */ static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -/* FetchSharedCythonModule.proto */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void); +/* AddModuleRef.proto (used by FetchSharedCythonModule) */ +#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\ + __PYX_LIMITED_VERSION_HEX < 0x030d0000) + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name); +#else + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#endif -/* dict_setdefault.proto */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); +/* FetchSharedCythonModule.proto (used by FetchCommonType) */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); -/* FetchCommonType.proto */ +/* FetchCommonType.proto (used by CommonTypesMetaclass) */ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); -/* CommonTypesMetaclass.proto */ +/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */ static int __pyx_CommonTypesMetaclass_init(PyObject *module); #define __Pyx_CommonTypesMetaclass_USED -/* CallTypeTraverse.proto */ +/* CallTypeTraverse.proto (used by CythonFunctionShared) */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 #else static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif -/* PyMethodNew.proto */ +/* PyMethodNew.proto (used by CythonFunctionShared) */ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); -/* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */ +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif -/* CythonFunctionShared.proto */ +/* CythonFunctionShared.proto (used by CythonFunction) */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 @@ -2413,14 +2482,15 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL ||\ - (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) +#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL __pyx_vectorcallfunc func_vectorcall; #endif #if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_dict; +#endif PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; @@ -2465,7 +2535,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) @@ -2482,56 +2552,125 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); -/* RaiseNoneIterError.proto */ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); -/* GetAttr.proto */ +/* GetAttr.proto (used by Globals) */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* Globals.proto */ static PyObject* __Pyx_Globals(void); -/* PyObjectGetMethod.proto */ -static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); - -/* PyObjectCallMethod0.proto */ -static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); - -/* ValidateBasesTuple.proto */ -#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS -static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); -#endif - -/* PyType_Ready.proto */ -CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* AssertionsEnabled.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000 + static int __pyx_assertions_enabled_flag; + #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) + #if __clang__ || __GNUC__ + __attribute__((no_sanitize("thread"))) + #endif + static int __Pyx_init_assertions_enabled(void) { + PyObject *builtins, *debug, *debug_str; + int flag; + builtins = PyEval_GetBuiltins(); + if (!builtins) goto bad; + debug_str = PyUnicode_FromStringAndSize("__debug__", 9); + if (!debug_str) goto bad; + debug = PyObject_GetItem(builtins, debug_str); + Py_DECREF(debug_str); + if (!debug) goto bad; + flag = PyObject_IsTrue(debug); + Py_DECREF(debug); + if (flag == -1) goto bad; + __pyx_assertions_enabled_flag = flag; + return 0; + bad: + __pyx_assertions_enabled_flag = 1; + return -1; + } +#else + #define __Pyx_init_assertions_enabled() (0) + #define __pyx_assertions_enabled() (!Py_OptimizeFlag) +#endif + +/* PyAssertionError_Check.proto */ +#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError) + +/* GetTopmostException.proto (used by SaveResetException) */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* CheckTypeForFreelists.proto */ +#if CYTHON_USE_FREELISTS +#if CYTHON_USE_TYPE_SPECS +#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp))) +#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS Py_TPFLAGS_IS_ABSTRACT +#else +#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size))) +#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE) +#endif +#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\ + (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\ + (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS))) +#endif + +/* AllocateExtensionType.proto */ +static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final); + +/* PyObjectGetMethod.proto (used by PyObjectCallMethod0) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); +#endif + +/* PyObjectCallMethod0.proto (used by PyType_Ready) */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* ValidateBasesTuple.proto (used by PyType_Ready) */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); +#endif + +/* PyType_Ready.proto */ +CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); + +/* HasAttr.proto (used by ImportImpl) */ +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) +#else +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); +#endif -/* ImportDottedModule.proto */ -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); +/* ImportImpl.export */ +static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level); -/* ListPack.proto */ -static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); +/* Import.proto */ +static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); -/* CLineInTraceback.proto */ +/* CLineInTraceback.proto (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #else #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif -/* CodeObjectCache.proto */ +/* CodeObjectCache.proto (used by AddTraceback) */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject __Pyx_CachedCodeObjectType; #else @@ -2562,7 +2701,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #define __Pyx_HAS_GCC_DIAGNOSTIC #endif -/* PyObjectVectorCallKwBuilder.proto */ +/* PyObjectVectorCallKwBuilder.proto (used by CIntToPy) */ CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); #if CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03090000 @@ -2630,7 +2769,16 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) #endif -/* SwapException.proto */ +/* GetRuntimeVersion.proto */ +#if __PYX_LIMITED_VERSION_HEX < 0x030b0000 +static unsigned long __Pyx_cached_runtime_version = 0; +static void __Pyx_init_runtime_version(void); +#else +#define __Pyx_init_runtime_version() +#endif +static unsigned long __Pyx_get_runtime_version(void); + +/* SwapException.proto (used by CoroutineBase) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); @@ -2638,19 +2786,19 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif -/* IterNextPlain.proto */ +/* IterNextPlain.proto (used by CoroutineBase) */ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator); #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void); #endif -/* PyObjectCallMethod1.proto */ +/* PyObjectCallMethod1.proto (used by CoroutineBase) */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); -/* ReturnWithStopIteration.proto */ +/* ReturnWithStopIteration.proto (used by CoroutineBase) */ static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext); -/* CoroutineBase.proto */ +/* CoroutineBase.proto (used by Generator) */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); #if CYTHON_USE_EXC_INFO_STACK @@ -2667,7 +2815,9 @@ typedef struct __pyx_CoroutineObject { __pyx_coroutine_body_t body; PyObject *closure; __Pyx_ExcInfoStruct gi_exc_state; +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *gi_weakreflist; +#endif PyObject *classobj; PyObject *yieldfrom; __Pyx_pyiter_sendfunc yieldfrom_am_send; @@ -2735,12 +2885,12 @@ static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); -/* GetRuntimeVersion.proto */ -static unsigned long __Pyx_get_runtime_version(void); - /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); +/* DecompressString.proto */ +static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo); + /* MultiPhaseInitModuleState.proto */ #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE static PyObject *__Pyx_State_FindModule(void*); @@ -2798,255 +2948,32 @@ int __pyx_module_is_main_constraint__parser = 0; /* Implementation of "constraint.parser" */ /* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_eval; -static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_compile; +static PyObject *__pyx_builtin_eval; /* #### Code section: string_decls ### */ -static const char __pyx_k_[] = "']]"; -static const char __pyx_k_1[] = "\2401"; -static const char __pyx_k_Q[] = "\260Q"; -static const char __pyx_k_i[] = "i"; -static const char __pyx_k_m[] = "m"; -static const char __pyx_k_o[] = "o"; -static const char __pyx_k_p[] = "p"; -static const char __pyx_k_q[] = "\240q"; -static const char __pyx_k_r[] = "r"; -static const char __pyx_k_s[] = "s"; -static const char __pyx_k_v[] = "v"; -static const char __pyx_k__2[] = "<="; -static const char __pyx_k__3[] = ">="; -static const char __pyx_k__4[] = ">"; -static const char __pyx_k__5[] = "<"; -static const char __pyx_k__6[] = "|"; -static const char __pyx_k__7[] = "=="; -static const char __pyx_k__8[] = "**"; -static const char __pyx_k__9[] = "*"; -static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k_or[] = " or "; -static const char __pyx_k_re[] = "re"; -static const char __pyx_k_1_2[] = "\2601"; -static const char __pyx_k_Q_2[] = "\300Q"; -static const char __pyx_k_Q_3[] = "\220Q"; -static const char __pyx_k__10[] = "+"; -static const char __pyx_k__11[] = "-"; -static const char __pyx_k__12[] = "/"; -static const char __pyx_k__13[] = "\\*\\*"; -static const char __pyx_k__14[] = "\\*"; -static const char __pyx_k__15[] = "\\+"; -static const char __pyx_k__16[] = "!="; -static const char __pyx_k__17[] = " "; -static const char __pyx_k__18[] = ""; -static const char __pyx_k__19[] = "("; -static const char __pyx_k__20[] = ")"; -static const char __pyx_k__21[] = ", "; -static const char __pyx_k__22[] = " \n"; -static const char __pyx_k__23[] = "."; -static const char __pyx_k__24[] = "?"; -static const char __pyx_k__25[] = "\250!"; -static const char __pyx_k__26[] = "\260!"; -static const char __pyx_k__27[] = "\270!"; -static const char __pyx_k_and[] = " and "; -static const char __pyx_k_end[] = "end"; -static const char __pyx_k_key[] = "key"; -static const char __pyx_k_pop[] = "pop"; -static const char __pyx_k_res[] = "res"; -static const char __pyx_k_str[] = "str"; -static const char __pyx_k_sub[] = "sub"; -static const char __pyx_k_dict[] = "dict"; -static const char __pyx_k_eval[] = "eval"; -static const char __pyx_k_exec[] = "exec"; -static const char __pyx_k_func[] = "__func__"; -static const char __pyx_k_left[] = "left"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_next[] = "next"; -static const char __pyx_k_send[] = "send"; -static const char __pyx_k_spec[] = "__spec__"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_Union[] = "Union"; -static const char __pyx_k_close[] = "close"; -static const char __pyx_k_def_r[] = "def r("; -static const char __pyx_k_group[] = "group"; -static const char __pyx_k_index[] = "index"; -static const char __pyx_k_param[] = "param"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_right[] = "right"; -static const char __pyx_k_split[] = "split"; -static const char __pyx_k_start[] = "start"; -static const char __pyx_k_strip[] = "strip"; -static const char __pyx_k_throw[] = "throw"; -static const char __pyx_k_types[] = "types"; -static const char __pyx_k_union[] = "union"; -static const char __pyx_k_value[] = "value"; -static const char __pyx_k_enable[] = "enable"; -static const char __pyx_k_func_2[] = "func"; -static const char __pyx_k_module[] = "__module__"; -static const char __pyx_k_number[] = "number"; -static const char __pyx_k_offset[] = "offset"; -static const char __pyx_k_params[] = "params"; -static const char __pyx_k_return[] = "return"; -static const char __pyx_k_search[] = "search"; -static const char __pyx_k_string[] = ""; -static const char __pyx_k_typing[] = "typing"; -static const char __pyx_k_compile[] = "compile"; -static const char __pyx_k_disable[] = "disable"; -static const char __pyx_k_domains[] = "domains"; -static const char __pyx_k_findall[] = "findall"; -static const char __pyx_k_genexpr[] = "genexpr"; -static const char __pyx_k_replace[] = "replace"; -static const char __pyx_k_Optional[] = "Optional"; -static const char __pyx_k_add_note[] = "add_note"; -static const char __pyx_k_finditer[] = "finditer"; -static const char __pyx_k_fromkeys[] = "fromkeys"; -static const char __pyx_k_left_num[] = "left_num"; -static const char __pyx_k_list_str[] = "list[str]"; -static const char __pyx_k_operator[] = "operator"; -static const char __pyx_k_qualname[] = "__qualname__"; -static const char __pyx_k_return_2[] = "): return "; -static const char __pyx_k_set_name[] = "__set_name__"; -static const char __pyx_k_splitted[] = "splitted"; -static const char __pyx_k_co_consts[] = "co_consts"; -static const char __pyx_k_isenabled[] = "isenabled"; -static const char __pyx_k_left_swap[] = "left_swap"; -static const char __pyx_k_next_stop[] = "next_stop"; -static const char __pyx_k_operators[] = "operators"; -static const char __pyx_k_picklable[] = "picklable"; -static const char __pyx_k_prev_stop[] = "prev_stop"; -static const char __pyx_k_right_num[] = "right_num"; -static const char __pyx_k_temp_copy[] = "temp_copy"; -static const char __pyx_k_variables[] = "variables"; -static const char __pyx_k_Constraint[] = "Constraint"; -static const char __pyx_k_ValueError[] = "ValueError"; -static const char __pyx_k_comparator[] = "comparator"; -static const char __pyx_k_constraint[] = "constraint"; -static const char __pyx_k_right_swap[] = "right_swap"; -static const char __pyx_k_Restriction[] = "Restriction "; -static const char __pyx_k_a_zA_Z__0_9[] = "([a-zA-Z_$0-9]*)"; -static const char __pyx_k_code_object[] = "code_object"; -static const char __pyx_k_comparators[] = "comparators"; -static const char __pyx_k_constraints[] = "constraints"; -static const char __pyx_k_params_used[] = "params_used"; -static const char __pyx_k_restriction[] = "restriction"; -static const char __pyx_k_tune_params[] = "tune_params"; -static const char __pyx_k_FunctionType[] = "FunctionType"; -static const char __pyx_k_initializing[] = "_initializing"; -static const char __pyx_k_is_coroutine[] = "_is_coroutine"; -static const char __pyx_k_match_object[] = "match_object"; -static const char __pyx_k_restrictions[] = "restrictions"; -static const char __pyx_k_XQ_Qa_z_5_q_q[] = "\320\010%\240X\250Q\330\014\r\340\020\031\230\024\230Q\230a\330\020\027\220z\240\021\240)\2505\260\001\330\020\027\220q\330\023\024\340\020\027\220q"; -static const char __pyx_k_class_getitem[] = "__class_getitem__"; -static const char __pyx_k_AssertionError[] = "AssertionError"; -static const char __pyx_k_left_remainder[] = "left_remainder"; -static const char __pyx_k_operators_left[] = "operators_left"; -static const char __pyx_k_replace_params[] = "replace_params"; -static const char __pyx_k_operators_found[] = "operators_found"; -static const char __pyx_k_operators_right[] = "operators_right"; -static const char __pyx_k_right_remainder[] = "right_remainder"; -static const char __pyx_k_A_l_4s_Cq_2V2Q_1[] = "\200A\330\010\016\210l\230&\240\001\240\021\330\010\013\2104\210s\220!\330\014\024\220C\220q\230\001\330\014\023\320\023+\2502\250V\2602\260Q\340\014\023\2201"; -static const char __pyx_k_Invalid_operator[] = "Invalid operator "; -static const char __pyx_k_MaxSumConstraint[] = "MaxSumConstraint"; -static const char __pyx_k_MinSumConstraint[] = "MinSumConstraint"; -static const char __pyx_k_equalities_found[] = "equalities_found"; -static const char __pyx_k_params_used_list[] = "params_used_list"; -static const char __pyx_k_unique_operators[] = "unique_operators"; -static const char __pyx_k_A_l_4s_Cq_t1A_1_1[] = "\200A\340\010\016\210l\230&\240\001\240\021\330\010\013\2104\210s\220!\330\014\024\220C\220q\230\001\330\014\027\220t\2301\230A\330\014\023\2201\340\014\023\2201"; -static const char __pyx_k_MaxProdConstraint[] = "MaxProdConstraint"; -static const char __pyx_k_MinProdConstraint[] = "MinProdConstraint"; -static const char __pyx_k_comparators_found[] = "comparators_found"; -static const char __pyx_k_constraint_parser[] = "constraint.parser"; -static const char __pyx_k_variables_on_left[] = "variables_on_left"; -static const char __pyx_k_AllEqualConstraint[] = "AllEqualConstraint"; -static const char __pyx_k_ExactSumConstraint[] = "ExactSumConstraint"; -static const char __pyx_k_FunctionConstraint[] = "FunctionConstraint"; -static const char __pyx_k_Invalid_comparator[] = "Invalid comparator "; -static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; -static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_inequalities_found[] = "inequalities_found"; -static const char __pyx_k_parse_restrictions[] = "parse_restrictions"; -static const char __pyx_k_parsed_restriction[] = "parsed_restriction"; -static const char __pyx_k_split_restrictions[] = "split_restrictions"; -static const char __pyx_k_ExactProdConstraint[] = "ExactProdConstraint"; -static const char __pyx_k_a_zA_Z__a_zA_Z__0_9[] = "([a-zA-Z_$][a-zA-Z_$0-9]*)"; -static const char __pyx_k_comparators_indices[] = "comparators_indices"; -static const char __pyx_k_params_params_index[] = "params[params_index['"; -static const char __pyx_k_parsed_restrictions[] = "parsed_restrictions"; -static const char __pyx_k_supported_operators[] = "supported_operators"; -static const char __pyx_k_compiled_constraints[] = "compiled_constraints"; -static const char __pyx_k_constraint_parser_py[] = "constraint/parser.py"; -static const char __pyx_k_finalized_constraint[] = "finalized_constraint"; -static const char __pyx_k_regex_match_variable[] = "regex_match_variable"; -static const char __pyx_k_replace_params_split[] = "replace_params_split"; -static const char __pyx_k_restrictions_cleaned[] = "restrictions_cleaned"; -static const char __pyx_k_is_or_evals_to_number[] = "is_or_evals_to_number"; -static const char __pyx_k_to_numeric_constraint[] = "to_numeric_constraint"; -static const char __pyx_k_unique_operators_left[] = "unique_operators_left"; -static const char __pyx_k_AllDifferentConstraint[] = "AllDifferentConstraint"; -static const char __pyx_k_compile_to_constraints[] = "compile_to_constraints"; -static const char __pyx_k_constraint_constraints[] = "constraint.constraints"; -static const char __pyx_k_to_equality_constraint[] = "to_equality_constraint"; -static const char __pyx_k_unique_operators_right[] = "unique_operators_right"; -static const char __pyx_k_variable_operators_left[] = "variable_operators_left"; -static const char __pyx_k_Optional_Union_int_float[] = "Optional[Union[int, float]]"; -static const char __pyx_k_VariableMaxSumConstraint[] = "VariableMaxSumConstraint"; -static const char __pyx_k_VariableMinSumConstraint[] = "VariableMinSumConstraint"; -static const char __pyx_k_to_multiple_restrictions[] = "to_multiple_restrictions"; -static const char __pyx_k_variable_operators_right[] = "variable_operators_right"; -static const char __pyx_k_VariableMaxProdConstraint[] = "VariableMaxProdConstraint"; -static const char __pyx_k_VariableMinProdConstraint[] = "VariableMinProdConstraint"; -static const char __pyx_k_variable_unique_operators[] = "variable_unique_operators"; -static const char __pyx_k_VariableExactSumConstraint[] = "VariableExactSumConstraint"; -static const char __pyx_k_VariableExactProdConstraint[] = "VariableExactProdConstraint"; -static const char __pyx_k_restrictions_cleaned_unique[] = "restrictions_cleaned_unique"; -static const char __pyx_k_restrictions_unique_indices[] = "restrictions_unique_indices"; -static const char __pyx_k_CompilableFunctionConstraint[] = "CompilableFunctionConstraint"; -static const char __pyx_k_swapped_side_first_component[] = "swapped_side_first_component"; -static const char __pyx_k_variable_supported_operators[] = "variable_supported_operators"; -static const char __pyx_k_A_3axs_C_1_avV6_a_Bhas_q_a_3a_Q[] = "\200A\330\025\"\240!\330\t\n\360\006\000\t\014\2103\210a\210x\220s\230\"\230C\230{\250!\330\014\023\2201\340\010\026\220a\220v\230V\2406\250\025\250a\330\010\034\230B\230h\240a\240s\250%\250q\260\016\270a\340\010\013\2103\210a\320\017\"\240#\240Q\330\014\023\2201\330\010\025\320\025&\240a\240q\360\006\000\t\017\210h\220e\2308\2401\360\006\000\t\037\230a\230v\240U\250%\250u\260A\330\010\031\230\021\230!\2306\240\023\240D\250\005\250T\260\021\260&\270\003\2702\270S\300\001\330\010\032\230!\2301\230F\240#\240T\250\025\250d\260!\2607\270#\270R\270s\300!\340\010\013\2103\210a\320\017\037\230r\240\022\2404\240s\250!\320+<\270B\270a\340\014\023\2201\330\010 \240\003\2401\240A\330\010!\240\023\240A\240Q\330\010\033\320\0330\260\006\260a\260q\330\010\013\2103\210a\320\017!\240\023\240A\330\014 \240\003\2401\320$;\2702\270Q\330\014+\2502\250W\260A\3205W\320W_\320_v\320vw\330\014\017\320\017,\250C\250q\340\020\027\220q\340\020/\320/K\3106\320QR\320RS\330\014\017\210t\2203\220a\330\020\023\2204\220q\340\024&\240e\2501\250C\250q\260\001\330\024 \240\017\250x\260q\270\005\270Q\330\024\"\240\"\240D\250\006\250k\270\034\300Q\360\006\000\025&\240T\250\021\250#\250Q\250a\330\024!\240\036\250x\260q\270\005\270Q\330\024\"\240\"\240D\320(F\300l\320RY\320YZ\330\014\017\210t\2203\220a\330\020\023\2204\220q\340\024&\240e\2501\250C\250q\260\001\330\024 \240\017\250x\260q\270\005\270Q\330\024\"\240\"\240D\250\006\250k\270\034\300Q\360\006\000\025&\240T\250\021\250#\250Q\250a\330\024!\240\036\250x\260q\270\005\270Q\330\024\"\240\"\240D\320(F\300l\320RY\320YZ\360\006\000\r\023\220(\230%\230x\240q\330\014\035\230Q\230a\230v\240S\250\004\250E\260\024\260Q\260f\270C\270r\300\023\300A\330\014\036\230a\230q\240\006\240c\250\024\250U\260$\260a\260w\270c\300\022\3003\300a\330\014$\240C\240q\250\001\330\014%\240S\250\001\250\021\330\014\037\320\0374\260F\270!\2701\360\006\000\t#\240#\240X\250Q\360\026\000\t\024\320\023(\250\001\250\021\330\010\024\320\024)\250\021\250!\330\010\014\210I\220S\230\005""\230T\240\032\2503\250f\260D\270\t\300\027\310\005\310T\320Q[\320[b\320bc\340\014+\2501\250E\260\021\340\014\030\230\002\230(\240!\320#9\270\021\360\006\000\r+\250(\260!\330\014+\2508\2601\330\014(\250\004\250A\250S\260\001\3201I\310\026\310q\320PS\320ST\320TU\340\014\017\210s\220!\320\023.\250c\260\022\3203E\320Ec\320ch\320hk\320kl\360\000\000m\001D\002\360\000\000D\002G\002\360\000\000G\002I\002\360\000\000I\002L\002\360\000\000L\002O\002\360\000\000O\002P\002\360\000\000P\002h\002\360\000\000h\002k\002\360\000\000k\002l\002\330\020$\240C\240q\320(?\270r\300\021\330\020\023\2203\220a\320\0272\260#\260R\260s\320:S\320ST\320TW\320WZ\320Z[\330\024\027\220{\240#\240Q\330\030\037\320\0379\270\021\270)\3002\300T\310\031\320RU\320U\\\320\\s\360\000\000t\001N\002\360\000\000N\002O\002\360\000\000O\002X\002\360\000\000X\002Y\002\360\000\000Y\002]\002\360\000\000]\002f\002\360\000\000f\002g\002\360\000\000g\002h\002\330\031$\240C\240q\340\030\037\320\0377\260q\270\t\300\022\3004\300y\320PS\320SZ\320Zq\360\000\000r\001J\002\360\000\000J\002K\002\360\000\000K\002T\002\360\000\000T\002U\002\360\000\000U\002Y\002\360\000\000Y\002b\002\360\000\000b\002c\002\360\000\000c\002d\002\330\031$\240C\240q\340\030\037\320\0377\260q\270\t\300\022\3004\300y\320PS\320SZ\320Zq\360\000\000r\001J\002\360\000\000J\002K\002\360\000\000K\002T\002\360\000\000T\002U\002\360\000\000U\002Y\002\360\000\000Y\002b\002\360\000\000b\002c\002\360\000\000c\002d\002\330\025.\250a\250s\260#\260Q\330\024\027\220{\240#\240Q\330\030\037\320\037:\270!\2709\300B\300d\310)\320SV\320V]\320]t\360\000\000u\001P\002\360\000\000P\002Q\002\360\000\000Q\002Z\002\360\000\000Z\002[\002\360\000\000[\002_\002\360\000\000_\002h\002\360\000\000h\002i\002\360\000\000i\002j\002\330\031$\240C\240q\340\030\037\320\0378\270\001\270\031\300\"\300D\310\t\320QT\320T[\320[r\360\000\000s\001L\002\360\000\000L\002M\002\360\000\000M\002V\002\360\000\000V\002W\002\360\000\000W\002[\002\360\000\000[\002d\002\360\000\000d\002e\002\360\000""\000e\002f\002\330\031$\240C\240q\340\030\037\320\0378\270\001\270\031\300\"\300D\310\t\320QT\320T[\320[r\360\000\000s\001L\002\360\000\000L\002M\002\360\000\000M\002V\002\360\000\000V\002W\002\360\000\000W\002[\002\360\000\000[\002d\002\360\000\000d\002e\002\360\000\000e\002f\002\360\006\000\r\024\2201\360\006\000\t\021\220\013\2301\330\014\r\210Z\220u\230F\240$\240j\260\t\270\027\300\013\310;\320VZ\320Z`\320`d\320de\360\010\000\t\022\220\021\330\010\013\210;\220c\230\021\330\014\017\210q\340\020\032\230!\360\006\000\021\033\230!\330\r\030\230\003\2301\330\014\017\210q\340\020\032\230!\360\006\000\021\033\230!\360\006\000\t\025\220A\220Y\230g\240Q\330\010\032\230\"\230H\240A\240S\250\001\250\023\250E\260\021\260-\270q\330\010\013\2103\210a\320\017 \240\003\2401\340\014\017\210s\220!\2208\2303\230b\240\003\240:\250W\260A\340\020\027\220q\360\006\000\022\035\230C\230q\330\020\027\320\027)\250\021\250!\330\021\034\230C\230u\240C\240{\260#\260Q\330\020\027\320\027'\240q\250\013\3203J\320JZ\320Z[\320[\\\330\021\034\230C\230u\240C\240{\260#\260Q\330\020\027\320\027'\240q\250\013\3203J\320JZ\320Z[\320[\\\330\014\022\220*\230A\230R\320\0376\260a\360\006\000\t\024\220?\240!\2401\330\010\013\210:\220Q\340\014\023\2201\360\006\000\t\024\2209\230F\240!\2401\340\010\013\2103\210a\210z\230\023\230C\230q\240\010\320(:\270!\340\014\017\210y\230\003\2301\340\020\027\220q\330\021\032\230#\230Q\330\020\023\220;\230c\240\021\330\024\033\320\033.\250a\250q\330\025 \240\003\2405\250\003\250;\260c\270\021\330\024\033\320\033,\250A\250[\3208O\320O`\320`a\320ab\330\025 \240\003\2405\250\003\250;\260c\270\021\330\024\033\320\033,\250A\250[\3208O\320O`\320`a\320ab\330\021\032\230#\230Q\330\020\023\220;\230c\240\021\330\024\033\320\033-\250Q\250a\330\025 \240\003\2405\250\003\250;\260c\270\021\340\024\033\320\033+\2501\250K\3207N\320N^\320^_\320_`\330\025 \240\003\2405\250\003\250;\260c\270\021\330\024\033\320\033+\2501\250K\3207N\320N^\320^_\320_`\340\020\026\220j\240\001\240\022\320#8\270""\001\330\010\017\210q"; -static const char __pyx_k_A_3axs_Qa_1_2XQfA_Rxq_a_5_AS_2S[] = "\200A\330\025\"\240!\330\t\n\360\006\000\t\014\2103\210a\210x\220s\230#\230Q\230a\330\014\023\2201\360\006\000\t\034\2302\230X\240Q\240f\250A\330\010\035\230R\230x\240q\250\006\250a\340\010\013\2105\220\004\220A\220S\230\001\320\031+\2502\250S\260\002\260$\260a\260s\270!\320;O\310r\320QR\330\014\023\2201\330\010\025\320\025%\240Q\240f\250C\250q\3200B\300\"\300G\320K]\320]^\320^_\360\006\000\t\024\220;\230f\240A\240Q\340\010\013\2103\210a\210z\230\023\230C\230q\240\010\320(:\270!\340\014\017\210{\230#\230Q\330\020\027\320\027)\250\021\330\021\034\230C\230q\330\020\027\320\027-\250Q\330\014\023\220:\230Q\230b\320 X\320XY\330\010\017\210q"; -static const char __pyx_k_FBVVW_A_UUV__A_Qm1_q_9_gQm_q_1K[] = "\320\000(\320(<\270F\320BV\320VW\360\026\000\005\033\320\032,\250A\250]\270!\330\004U\320UV\330\004\010\210\r\220_\240A\330\010\013\210:\220Q\220m\2401\340\014\017\210q\330\020\035\320\0359\270\021\270!\340\020\036\230g\240Q\240m\260<\270q\330\020\027\220|\2401\240K\250z\270\021\270$\270g\300Q\330\020\035\320\035/\250q\260\001\330\014 \240\007\240r\250\034\260]\300!\330\r\027\220q\230\r\240Q\340\014 \240\007\240r\250\035\260m\3001\340\014\022\220*\230A\230R\320\037/\320/_\320_c\320cd\320de\360\006\000\005\014\2101"; -static const char __pyx_k_Optional_Union_MinSumConstraint[] = "Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]"; -static const char __pyx_k_Q_G1_xs_c_1_6_uA_AV1D_Qd_e2YasR[] = "\320\004/\250~\270Q\340\010!\240\021\330\010\014\210G\2201\340\014\017\210x\220s\230$\230c\240\027\250\003\2501\330\020\"\240'\250\021\250!\330\020\021\340\014\032\230!\2306\240\026\240u\250A\330\014\"\240\"\240A\240V\2501\250D\260\001\260\024\260Q\260d\270$\270e\3002\300Y\310a\310s\320RW\320WX\320Xf\320fg\330\014\017\210s\220!\320\023(\250\003\2501\340\020\"\240'\250\021\250!\330\020\021\340\014\020\220\t\230\025\230a\230s\240!\2401\330\020\034\230A\330\020\034\320\034/\250q\260\006\260b\270\002\270!\2703\270b\300\005\300V\3102\310W\320TU\330\020\021\330\024'\240q\250\006\250b\260\002\260!\2606\270\026\270r\300\023\300A\320EZ\320Z\\\320\\c\320cf\320fg\320gh\340\020\"\240'\250\021\250)\2601\260J\270j\310\006\310a\330\010\017\210q"; -static const char __pyx_k_Ya_1_q_Q2_U_x_U_6_Q_q_t4uA_d_4y[] = "\320\000%\320%=\270Y\300a\360\006\000\005\034\2301\330\004'\240q\340\004\005\360\020\000\005\006\360\024\000\005\"\240\036\250~\270Q\3602\000\005\006\330\010\025\220U\230(\240!\330\t\n\360x\005\000\005\006\330\010\025\220U\230(\240!\330\t\n\3606\000\005\026\220Q\340\010\037\230q\240\001\240\030\250\021\250%\250t\2604\260u\270A\330\010&\240d\250!\2504\250y\270\001\270\021\340\010&\240a\320';\2706\300\021\300#\300T\310\025\310a\330\010\027\220q\230\014\240A\240S\250\004\250E\260\021\360\006\000\005\024\320\023+\2501\250A\340\004\036\230a\330\004\010\210\007\210q\330\010#\2401\330\010\035\230R\230t\2401\320$:\320:P\320PT\320TZ\320Z[\330\010\033\2304\230q\240\001\330\010\037\230q\330\010\013\2107\220'\230\024\230T\240\030\250\027\260\001\340\014\r\330\020\"\240!\2403\240c\250\021\330\020\024\320\024&\240b\250\003\2503\250a\330\020\024\220D\230\007\320\0371\260\021\260!\330\020\024\220D\230\007\320\0371\260\022\2601\340\020%\320%7\260q\270\003\2701\340\014#\320#8\270\001\3209M\310Q\330\014\017\320\017$\240C\240q\340\020'\320'=\270Q\320>R\320RS\330\010\013\320\013 \240\003\2401\340\014#\2402\240Z\250t\2605\270\001\3209V\320VW\330\010\033\2307\240\"\320$:\270!\340\004\013\2101"; -static const char __pyx_k_is_neither_a_string_or_Constrai[] = " is neither a string or Constraint "; -static const char __pyx_k_list_tuple_Union_Constraint_str[] = "list[tuple[Union[Constraint, str], list[str]]]"; static const char __pyx_k_Module_containing_the_code_for_p[] = "Module containing the code for parsing string constraints."; -static const char __pyx_k_Not_possible_comparator_should_b[] = "Not possible: comparator should be '==' or '!=', is "; -static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; -static const char __pyx_k_Optional_Union_AllEqualConstrain[] = "Optional[Union[AllEqualConstraint, AllDifferentConstraint]]"; -static const char __pyx_k_list_tuple_Constraint_list_str_U[] = "list[tuple[Constraint, list[str], Union[str, None]]]"; -static const char __pyx_k_parse_restrictions_locals_genexp[] = "parse_restrictions..genexpr"; -static const char __pyx_k_parse_restrictions_locals_replac[] = "parse_restrictions..replace_params"; -static const char __pyx_k_parse_restrictions_locals_to_equ[] = "parse_restrictions..to_equality_constraint..genexpr"; -static const char __pyx_k_parse_restrictions_locals_to_mul[] = "parse_restrictions..to_multiple_restrictions"; -static const char __pyx_k_parse_restrictions_locals_to_num[] = "parse_restrictions..to_numeric_constraint..genexpr..genexpr"; -static const char __pyx_k_regex_match_variable_or_constant[] = "regex_match_variable_or_constant"; -static const char __pyx_k_parse_restrictions_locals_replac_2[] = "parse_restrictions..replace_params_split"; -static const char __pyx_k_parse_restrictions_locals_to_equ_2[] = "parse_restrictions..to_equality_constraint"; -static const char __pyx_k_parse_restrictions_locals_to_num_2[] = "parse_restrictions..to_numeric_constraint..genexpr"; -static const char __pyx_k_parse_restrictions_locals_to_num_3[] = "parse_restrictions..to_numeric_constraint..is_or_evals_to_number"; -static const char __pyx_k_parse_restrictions_locals_to_num_4[] = "parse_restrictions..to_numeric_constraint"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_params(PyObject *__pyx_self, PyObject *__pyx_v_match_object); /* proto */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_params_split(PyObject *__pyx_self, PyObject *__pyx_v_match_object); /* proto */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple_restrictions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_restrictions); /* proto */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0, PyObject *__pyx_genexpr_arg_1); /* proto */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0, PyObject *__pyx_genexpr_arg_1); /* proto */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0, PyObject *__pyx_genexpr_arg_1); /* proto */ +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_6genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0, PyObject *__pyx_genexpr_arg_1); /* proto */ +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_9genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_12genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_15genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_18genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_21genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_24genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params); /* proto */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equality_constraint_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality_constraint(PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params); /* proto */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_restrictions, PyObject *__pyx_v_tune_params); /* proto */ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_constraints, PyObject *__pyx_v_domains, PyObject *__pyx_v_picklable); /* proto */ +static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */ +static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_expr); /* proto */ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3058,9 +2985,10 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr( static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_9_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_13_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ /* SmallCodeConfig */ @@ -3081,24 +3009,6 @@ typedef struct { PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED - PyTypeObject *__pyx_CyFunctionType; - #endif - #ifdef __Pyx_FusedFunction_USED - PyTypeObject *__pyx_FusedFunctionType; - #endif - #ifdef __Pyx_Generator_USED - PyTypeObject *__pyx_GeneratorType; - #endif - #ifdef __Pyx_IterableCoroutine_USED - PyTypeObject *__pyx_IterableCoroutineType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineAwaitType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineType; - #endif PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions; PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint; PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr; @@ -3110,9 +3020,10 @@ typedef struct { PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr; PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr; PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr; - PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint; - PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr; + PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr; + PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint; PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr; + PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr; @@ -3124,19 +3035,22 @@ typedef struct { PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr; - PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint; - PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr; + PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr; + PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr; + PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values; __Pyx_CachedCFunction __pyx_umethod_PyList_Type__index; __Pyx_CachedCFunction __pyx_umethod_PySet_Type__union; + __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type__strip; PyObject *__pyx_slice[4]; PyObject *__pyx_tuple[4]; - PyObject *__pyx_codeobj_tab[19]; - PyObject *__pyx_string_tab[205]; - PyObject *__pyx_int_0; - PyObject *__pyx_int_1; - PyObject *__pyx_int_neg_1; + PyObject *__pyx_codeobj_tab[21]; + PyObject *__pyx_string_tab[230]; + PyObject *__pyx_number_tab[3]; /* #### Code section: module_state_contents ### */ /* CommonTypesMetaclass.module_state_decls */ PyTypeObject *__pyx_CommonTypesMetaclassType; @@ -3146,6 +3060,9 @@ PyTypeObject *__pyx_CommonTypesMetaclassType; PyObject *__Pyx_CachedMethodType; #endif +/* CythonFunctionShared.module_state_decls */ +PyTypeObject *__pyx_CyFunctionType; + #if CYTHON_USE_FREELISTS struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[8]; @@ -3203,19 +3120,24 @@ int __pyx_freecount_10constraint_6parser___pyx_scope_struct_10_genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *__pyx_freelist_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint[8]; -int __pyx_freecount_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint; +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_11_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_11_genexpr; #endif #if CYTHON_USE_FREELISTS -struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_12_genexpr[8]; -int __pyx_freecount_10constraint_6parser___pyx_scope_struct_12_genexpr; +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *__pyx_freelist_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint; #endif #if CYTHON_USE_FREELISTS struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_13_genexpr[8]; int __pyx_freecount_10constraint_6parser___pyx_scope_struct_13_genexpr; #endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_14_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_14_genexpr; +#endif /* CodeObjectCache.module_state_decls */ struct __Pyx_CodeObjectCache __pyx_code_cache; @@ -3224,6 +3146,9 @@ struct __Pyx_CodeObjectCache __pyx_code_cache; PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; #endif +/* Generator.module_state_decls */ +PyTypeObject *__pyx_GeneratorType; + /* #### Code section: module_state_end ### */ } __pyx_mstatetype; @@ -3250,210 +3175,238 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #endif /* #### Code section: constant_name_defines ### */ #define __pyx_kp_u_ __pyx_string_tab[0] -#define __pyx_n_u_AllDifferentConstraint __pyx_string_tab[1] -#define __pyx_n_u_AllEqualConstraint __pyx_string_tab[2] -#define __pyx_n_u_AssertionError __pyx_string_tab[3] -#define __pyx_n_u_CompilableFunctionConstraint __pyx_string_tab[4] -#define __pyx_n_u_Constraint __pyx_string_tab[5] -#define __pyx_n_u_ExactProdConstraint __pyx_string_tab[6] -#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[7] -#define __pyx_n_u_FunctionConstraint __pyx_string_tab[8] -#define __pyx_n_u_FunctionType __pyx_string_tab[9] -#define __pyx_kp_u_Invalid_comparator __pyx_string_tab[10] -#define __pyx_kp_u_Invalid_operator __pyx_string_tab[11] -#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[12] -#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[13] -#define __pyx_n_u_MinProdConstraint __pyx_string_tab[14] -#define __pyx_n_u_MinSumConstraint __pyx_string_tab[15] -#define __pyx_kp_u_Not_possible_comparator_should_b __pyx_string_tab[16] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[17] -#define __pyx_n_u_Optional __pyx_string_tab[18] -#define __pyx_kp_u_Optional_Union_AllEqualConstrain __pyx_string_tab[19] -#define __pyx_kp_u_Optional_Union_MinSumConstraint __pyx_string_tab[20] -#define __pyx_kp_u_Optional_Union_int_float __pyx_string_tab[21] -#define __pyx_kp_u_Restriction __pyx_string_tab[22] -#define __pyx_n_u_Union __pyx_string_tab[23] -#define __pyx_n_u_ValueError __pyx_string_tab[24] -#define __pyx_n_u_VariableExactProdConstraint __pyx_string_tab[25] -#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[26] -#define __pyx_n_u_VariableMaxProdConstraint __pyx_string_tab[27] -#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[28] -#define __pyx_n_u_VariableMinProdConstraint __pyx_string_tab[29] -#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[30] -#define __pyx_kp_u__10 __pyx_string_tab[31] -#define __pyx_kp_u__11 __pyx_string_tab[32] -#define __pyx_kp_u__12 __pyx_string_tab[33] -#define __pyx_kp_u__13 __pyx_string_tab[34] -#define __pyx_kp_u__14 __pyx_string_tab[35] -#define __pyx_kp_u__15 __pyx_string_tab[36] -#define __pyx_kp_u__16 __pyx_string_tab[37] -#define __pyx_kp_u__17 __pyx_string_tab[38] -#define __pyx_kp_u__18 __pyx_string_tab[39] -#define __pyx_kp_u__19 __pyx_string_tab[40] -#define __pyx_kp_u__2 __pyx_string_tab[41] -#define __pyx_kp_u__20 __pyx_string_tab[42] -#define __pyx_kp_u__21 __pyx_string_tab[43] -#define __pyx_kp_u__22 __pyx_string_tab[44] -#define __pyx_kp_u__23 __pyx_string_tab[45] -#define __pyx_kp_u__24 __pyx_string_tab[46] -#define __pyx_kp_u__3 __pyx_string_tab[47] -#define __pyx_kp_u__4 __pyx_string_tab[48] -#define __pyx_kp_u__5 __pyx_string_tab[49] -#define __pyx_kp_u__6 __pyx_string_tab[50] -#define __pyx_kp_u__7 __pyx_string_tab[51] -#define __pyx_kp_u__8 __pyx_string_tab[52] -#define __pyx_kp_u__9 __pyx_string_tab[53] -#define __pyx_kp_u_a_zA_Z__0_9 __pyx_string_tab[54] -#define __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 __pyx_string_tab[55] -#define __pyx_kp_u_add_note __pyx_string_tab[56] -#define __pyx_kp_u_and __pyx_string_tab[57] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[58] -#define __pyx_n_u_class_getitem __pyx_string_tab[59] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[60] -#define __pyx_n_u_close __pyx_string_tab[61] -#define __pyx_n_u_co_consts __pyx_string_tab[62] -#define __pyx_n_u_code_object __pyx_string_tab[63] -#define __pyx_n_u_comparator __pyx_string_tab[64] -#define __pyx_n_u_comparators __pyx_string_tab[65] -#define __pyx_n_u_comparators_found __pyx_string_tab[66] -#define __pyx_n_u_comparators_indices __pyx_string_tab[67] -#define __pyx_n_u_compile __pyx_string_tab[68] -#define __pyx_n_u_compile_to_constraints __pyx_string_tab[69] -#define __pyx_n_u_compiled_constraints __pyx_string_tab[70] -#define __pyx_n_u_constraint __pyx_string_tab[71] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[72] -#define __pyx_n_u_constraint_parser __pyx_string_tab[73] -#define __pyx_kp_u_constraint_parser_py __pyx_string_tab[74] -#define __pyx_n_u_constraints __pyx_string_tab[75] -#define __pyx_kp_u_def_r __pyx_string_tab[76] -#define __pyx_n_u_dict __pyx_string_tab[77] -#define __pyx_kp_u_disable __pyx_string_tab[78] -#define __pyx_n_u_domains __pyx_string_tab[79] -#define __pyx_kp_u_enable __pyx_string_tab[80] -#define __pyx_n_u_end __pyx_string_tab[81] -#define __pyx_n_u_equalities_found __pyx_string_tab[82] -#define __pyx_n_u_eval __pyx_string_tab[83] -#define __pyx_n_u_exec __pyx_string_tab[84] -#define __pyx_n_u_finalized_constraint __pyx_string_tab[85] -#define __pyx_n_u_findall __pyx_string_tab[86] -#define __pyx_n_u_finditer __pyx_string_tab[87] -#define __pyx_n_u_fromkeys __pyx_string_tab[88] -#define __pyx_n_u_func __pyx_string_tab[89] -#define __pyx_n_u_func_2 __pyx_string_tab[90] -#define __pyx_kp_u_gc __pyx_string_tab[91] -#define __pyx_n_u_genexpr __pyx_string_tab[92] -#define __pyx_n_u_group __pyx_string_tab[93] -#define __pyx_n_u_i __pyx_string_tab[94] -#define __pyx_n_u_index __pyx_string_tab[95] -#define __pyx_n_u_inequalities_found __pyx_string_tab[96] -#define __pyx_n_u_initializing __pyx_string_tab[97] -#define __pyx_n_u_is_coroutine __pyx_string_tab[98] -#define __pyx_kp_u_is_neither_a_string_or_Constrai __pyx_string_tab[99] -#define __pyx_n_u_is_or_evals_to_number __pyx_string_tab[100] -#define __pyx_kp_u_isenabled __pyx_string_tab[101] -#define __pyx_n_u_key __pyx_string_tab[102] -#define __pyx_n_u_left __pyx_string_tab[103] -#define __pyx_n_u_left_num __pyx_string_tab[104] -#define __pyx_n_u_left_remainder __pyx_string_tab[105] -#define __pyx_n_u_left_swap __pyx_string_tab[106] -#define __pyx_kp_u_list_str __pyx_string_tab[107] -#define __pyx_kp_u_list_tuple_Constraint_list_str_U __pyx_string_tab[108] -#define __pyx_kp_u_list_tuple_Union_Constraint_str __pyx_string_tab[109] -#define __pyx_n_u_m __pyx_string_tab[110] -#define __pyx_n_u_main __pyx_string_tab[111] -#define __pyx_n_u_match_object __pyx_string_tab[112] -#define __pyx_n_u_module __pyx_string_tab[113] -#define __pyx_n_u_name __pyx_string_tab[114] -#define __pyx_n_u_next __pyx_string_tab[115] -#define __pyx_n_u_next_stop __pyx_string_tab[116] -#define __pyx_n_u_number __pyx_string_tab[117] -#define __pyx_n_u_o __pyx_string_tab[118] -#define __pyx_n_u_offset __pyx_string_tab[119] -#define __pyx_n_u_operator __pyx_string_tab[120] -#define __pyx_n_u_operators __pyx_string_tab[121] -#define __pyx_n_u_operators_found __pyx_string_tab[122] -#define __pyx_n_u_operators_left __pyx_string_tab[123] -#define __pyx_n_u_operators_right __pyx_string_tab[124] -#define __pyx_kp_u_or __pyx_string_tab[125] -#define __pyx_n_u_p __pyx_string_tab[126] -#define __pyx_n_u_param __pyx_string_tab[127] -#define __pyx_n_u_params __pyx_string_tab[128] -#define __pyx_kp_u_params_params_index __pyx_string_tab[129] -#define __pyx_n_u_params_used __pyx_string_tab[130] -#define __pyx_n_u_params_used_list __pyx_string_tab[131] -#define __pyx_n_u_parse_restrictions __pyx_string_tab[132] -#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[133] -#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[134] -#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[135] -#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[136] -#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[137] -#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[138] -#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[139] -#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[140] -#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[141] -#define __pyx_n_u_parse_restrictions_locals_to_num_4 __pyx_string_tab[142] -#define __pyx_n_u_parsed_restriction __pyx_string_tab[143] -#define __pyx_n_u_parsed_restrictions __pyx_string_tab[144] -#define __pyx_n_u_picklable __pyx_string_tab[145] -#define __pyx_n_u_pop __pyx_string_tab[146] -#define __pyx_n_u_prev_stop __pyx_string_tab[147] -#define __pyx_n_u_qualname __pyx_string_tab[148] -#define __pyx_n_u_r __pyx_string_tab[149] -#define __pyx_n_u_range __pyx_string_tab[150] -#define __pyx_n_u_re __pyx_string_tab[151] -#define __pyx_n_u_regex_match_variable __pyx_string_tab[152] -#define __pyx_n_u_regex_match_variable_or_constant __pyx_string_tab[153] -#define __pyx_n_u_replace __pyx_string_tab[154] -#define __pyx_n_u_replace_params __pyx_string_tab[155] -#define __pyx_n_u_replace_params_split __pyx_string_tab[156] -#define __pyx_n_u_res __pyx_string_tab[157] -#define __pyx_n_u_restriction __pyx_string_tab[158] -#define __pyx_n_u_restrictions __pyx_string_tab[159] -#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[160] -#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[161] -#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[162] -#define __pyx_n_u_return __pyx_string_tab[163] -#define __pyx_kp_u_return_2 __pyx_string_tab[164] -#define __pyx_n_u_right __pyx_string_tab[165] -#define __pyx_n_u_right_num __pyx_string_tab[166] -#define __pyx_n_u_right_remainder __pyx_string_tab[167] -#define __pyx_n_u_right_swap __pyx_string_tab[168] -#define __pyx_n_u_s __pyx_string_tab[169] -#define __pyx_n_u_search __pyx_string_tab[170] -#define __pyx_n_u_send __pyx_string_tab[171] -#define __pyx_n_u_set_name __pyx_string_tab[172] -#define __pyx_n_u_spec __pyx_string_tab[173] -#define __pyx_n_u_split __pyx_string_tab[174] -#define __pyx_n_u_split_restrictions __pyx_string_tab[175] -#define __pyx_n_u_splitted __pyx_string_tab[176] -#define __pyx_n_u_start __pyx_string_tab[177] -#define __pyx_n_u_str __pyx_string_tab[178] -#define __pyx_kp_u_string __pyx_string_tab[179] -#define __pyx_n_u_strip __pyx_string_tab[180] -#define __pyx_n_u_sub __pyx_string_tab[181] -#define __pyx_n_u_supported_operators __pyx_string_tab[182] -#define __pyx_n_u_swapped_side_first_component __pyx_string_tab[183] -#define __pyx_n_u_temp_copy __pyx_string_tab[184] -#define __pyx_n_u_test __pyx_string_tab[185] -#define __pyx_n_u_throw __pyx_string_tab[186] -#define __pyx_n_u_to_equality_constraint __pyx_string_tab[187] -#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[188] -#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[189] -#define __pyx_n_u_tune_params __pyx_string_tab[190] -#define __pyx_n_u_types __pyx_string_tab[191] -#define __pyx_n_u_typing __pyx_string_tab[192] -#define __pyx_n_u_union __pyx_string_tab[193] -#define __pyx_n_u_unique_operators __pyx_string_tab[194] -#define __pyx_n_u_unique_operators_left __pyx_string_tab[195] -#define __pyx_n_u_unique_operators_right __pyx_string_tab[196] -#define __pyx_n_u_v __pyx_string_tab[197] -#define __pyx_n_u_value __pyx_string_tab[198] -#define __pyx_n_u_variable_operators_left __pyx_string_tab[199] -#define __pyx_n_u_variable_operators_right __pyx_string_tab[200] -#define __pyx_n_u_variable_supported_operators __pyx_string_tab[201] -#define __pyx_n_u_variable_unique_operators __pyx_string_tab[202] -#define __pyx_n_u_variables __pyx_string_tab[203] -#define __pyx_n_u_variables_on_left __pyx_string_tab[204] +#define __pyx_kp_u_AllEqualConstraint_AllDifferentC __pyx_string_tab[1] +#define __pyx_kp_u_Invalid_comparator __pyx_string_tab[2] +#define __pyx_kp_u_Invalid_operator __pyx_string_tab[3] +#define __pyx_kp_u_MinSumConstraint_VariableMinSumC __pyx_string_tab[4] +#define __pyx_kp_u_Not_possible_comparator_should_b __pyx_string_tab[5] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[6] +#define __pyx_kp_u_Restriction __pyx_string_tab[7] +#define __pyx_kp_u_Variables __pyx_string_tab[8] +#define __pyx_kp_u__10 __pyx_string_tab[9] +#define __pyx_kp_u__11 __pyx_string_tab[10] +#define __pyx_kp_u__12 __pyx_string_tab[11] +#define __pyx_kp_u__13 __pyx_string_tab[12] +#define __pyx_kp_u__14 __pyx_string_tab[13] +#define __pyx_kp_u__15 __pyx_string_tab[14] +#define __pyx_kp_u__16 __pyx_string_tab[15] +#define __pyx_kp_u__17 __pyx_string_tab[16] +#define __pyx_kp_u__18 __pyx_string_tab[17] +#define __pyx_kp_u__19 __pyx_string_tab[18] +#define __pyx_kp_u__2 __pyx_string_tab[19] +#define __pyx_kp_u__20 __pyx_string_tab[20] +#define __pyx_kp_u__21 __pyx_string_tab[21] +#define __pyx_kp_u__22 __pyx_string_tab[22] +#define __pyx_kp_u__23 __pyx_string_tab[23] +#define __pyx_kp_u__24 __pyx_string_tab[24] +#define __pyx_kp_u__3 __pyx_string_tab[25] +#define __pyx_kp_u__4 __pyx_string_tab[26] +#define __pyx_kp_u__5 __pyx_string_tab[27] +#define __pyx_kp_u__6 __pyx_string_tab[28] +#define __pyx_kp_u__7 __pyx_string_tab[29] +#define __pyx_kp_u__8 __pyx_string_tab[30] +#define __pyx_kp_u__9 __pyx_string_tab[31] +#define __pyx_kp_u_a_zA_Z__0_9 __pyx_string_tab[32] +#define __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 __pyx_string_tab[33] +#define __pyx_kp_u_add_note __pyx_string_tab[34] +#define __pyx_kp_u_and __pyx_string_tab[35] +#define __pyx_kp_u_constraint_parser_py __pyx_string_tab[36] +#define __pyx_kp_u_d __pyx_string_tab[37] +#define __pyx_kp_u_def_r __pyx_string_tab[38] +#define __pyx_kp_u_disable __pyx_string_tab[39] +#define __pyx_kp_u_enable __pyx_string_tab[40] +#define __pyx_kp_u_gc __pyx_string_tab[41] +#define __pyx_kp_u_int_float_None __pyx_string_tab[42] +#define __pyx_kp_u_is_neither_a_string_or_Constrai __pyx_string_tab[43] +#define __pyx_kp_u_isenabled __pyx_string_tab[44] +#define __pyx_kp_u_list_str __pyx_string_tab[45] +#define __pyx_kp_u_list_tuple_Constraint_list_str_s __pyx_string_tab[46] +#define __pyx_kp_u_list_tuple_Constraint_str_list_s __pyx_string_tab[47] +#define __pyx_kp_u_match_but_not_w_d_binary_preced __pyx_string_tab[48] +#define __pyx_kp_u_not_in_tune_params __pyx_string_tab[49] +#define __pyx_kp_u_or __pyx_string_tab[50] +#define __pyx_kp_u_params_params_index __pyx_string_tab[51] +#define __pyx_kp_u_return_2 __pyx_string_tab[52] +#define __pyx_kp_u_string __pyx_string_tab[53] +#define __pyx_n_u_AllDifferentConstraint __pyx_string_tab[54] +#define __pyx_n_u_AllEqualConstraint __pyx_string_tab[55] +#define __pyx_n_u_CompilableFunctionConstraint __pyx_string_tab[56] +#define __pyx_n_u_Constraint __pyx_string_tab[57] +#define __pyx_n_u_ExactProdConstraint __pyx_string_tab[58] +#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[59] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[60] +#define __pyx_n_u_FunctionType __pyx_string_tab[61] +#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[62] +#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[63] +#define __pyx_n_u_MinProdConstraint __pyx_string_tab[64] +#define __pyx_n_u_MinSumConstraint __pyx_string_tab[65] +#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[66] +#define __pyx_n_u_VERBOSE __pyx_string_tab[67] +#define __pyx_n_u_VariableExactProdConstraint __pyx_string_tab[68] +#define __pyx_n_u_VariableExactSumConstraint __pyx_string_tab[69] +#define __pyx_n_u_VariableMaxProdConstraint __pyx_string_tab[70] +#define __pyx_n_u_VariableMaxSumConstraint __pyx_string_tab[71] +#define __pyx_n_u_VariableMinProdConstraint __pyx_string_tab[72] +#define __pyx_n_u_VariableMinSumConstraint __pyx_string_tab[73] +#define __pyx_n_u_annotate __pyx_string_tab[74] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[75] +#define __pyx_n_u_class_getitem __pyx_string_tab[76] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[77] +#define __pyx_n_u_close __pyx_string_tab[78] +#define __pyx_n_u_co_consts __pyx_string_tab[79] +#define __pyx_n_u_code_object __pyx_string_tab[80] +#define __pyx_n_u_comparator __pyx_string_tab[81] +#define __pyx_n_u_comparators __pyx_string_tab[82] +#define __pyx_n_u_comparators_found __pyx_string_tab[83] +#define __pyx_n_u_comparators_indices __pyx_string_tab[84] +#define __pyx_n_u_compile __pyx_string_tab[85] +#define __pyx_n_u_compile_to_constraints __pyx_string_tab[86] +#define __pyx_n_u_compiled_constraints __pyx_string_tab[87] +#define __pyx_n_u_constraint __pyx_string_tab[88] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[89] +#define __pyx_n_u_constraint_parser __pyx_string_tab[90] +#define __pyx_n_u_constraints __pyx_string_tab[91] +#define __pyx_n_u_dict __pyx_string_tab[92] +#define __pyx_n_u_domains __pyx_string_tab[93] +#define __pyx_n_u_end __pyx_string_tab[94] +#define __pyx_n_u_equalities_found __pyx_string_tab[95] +#define __pyx_n_u_eval __pyx_string_tab[96] +#define __pyx_n_u_exec __pyx_string_tab[97] +#define __pyx_n_u_expr __pyx_string_tab[98] +#define __pyx_n_u_extract_operators __pyx_string_tab[99] +#define __pyx_n_u_finalized_constraint __pyx_string_tab[100] +#define __pyx_n_u_findall __pyx_string_tab[101] +#define __pyx_n_u_finditer __pyx_string_tab[102] +#define __pyx_n_u_fromkeys __pyx_string_tab[103] +#define __pyx_n_u_func __pyx_string_tab[104] +#define __pyx_n_u_func_2 __pyx_string_tab[105] +#define __pyx_n_u_genexpr __pyx_string_tab[106] +#define __pyx_n_u_group __pyx_string_tab[107] +#define __pyx_n_u_i __pyx_string_tab[108] +#define __pyx_n_u_index __pyx_string_tab[109] +#define __pyx_n_u_inequalities_found __pyx_string_tab[110] +#define __pyx_n_u_is_coroutine __pyx_string_tab[111] +#define __pyx_n_u_is_or_evals_to_number __pyx_string_tab[112] +#define __pyx_n_u_items __pyx_string_tab[113] +#define __pyx_n_u_key __pyx_string_tab[114] +#define __pyx_n_u_keys __pyx_string_tab[115] +#define __pyx_n_u_left __pyx_string_tab[116] +#define __pyx_n_u_left_num __pyx_string_tab[117] +#define __pyx_n_u_left_remainder __pyx_string_tab[118] +#define __pyx_n_u_left_swap __pyx_string_tab[119] +#define __pyx_n_u_m __pyx_string_tab[120] +#define __pyx_n_u_main __pyx_string_tab[121] +#define __pyx_n_u_match_object __pyx_string_tab[122] +#define __pyx_n_u_matches __pyx_string_tab[123] +#define __pyx_n_u_module __pyx_string_tab[124] +#define __pyx_n_u_name __pyx_string_tab[125] +#define __pyx_n_u_next __pyx_string_tab[126] +#define __pyx_n_u_next_stop __pyx_string_tab[127] +#define __pyx_n_u_number __pyx_string_tab[128] +#define __pyx_n_u_o __pyx_string_tab[129] +#define __pyx_n_u_offset __pyx_string_tab[130] +#define __pyx_n_u_operator __pyx_string_tab[131] +#define __pyx_n_u_operators __pyx_string_tab[132] +#define __pyx_n_u_operators_found __pyx_string_tab[133] +#define __pyx_n_u_operators_left __pyx_string_tab[134] +#define __pyx_n_u_operators_right __pyx_string_tab[135] +#define __pyx_n_u_p __pyx_string_tab[136] +#define __pyx_n_u_param __pyx_string_tab[137] +#define __pyx_n_u_params __pyx_string_tab[138] +#define __pyx_n_u_params_used __pyx_string_tab[139] +#define __pyx_n_u_params_used_list __pyx_string_tab[140] +#define __pyx_n_u_parse_restrictions __pyx_string_tab[141] +#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[142] +#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[143] +#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[144] +#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[145] +#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[146] +#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[147] +#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[148] +#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[149] +#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[150] +#define __pyx_n_u_parsed_restriction __pyx_string_tab[151] +#define __pyx_n_u_parsed_restrictions __pyx_string_tab[152] +#define __pyx_n_u_pattern __pyx_string_tab[153] +#define __pyx_n_u_picklable __pyx_string_tab[154] +#define __pyx_n_u_pop __pyx_string_tab[155] +#define __pyx_n_u_prev_stop __pyx_string_tab[156] +#define __pyx_n_u_qualname __pyx_string_tab[157] +#define __pyx_n_u_r __pyx_string_tab[158] +#define __pyx_n_u_re __pyx_string_tab[159] +#define __pyx_n_u_regex_match_variable __pyx_string_tab[160] +#define __pyx_n_u_regex_match_variable_or_constant __pyx_string_tab[161] +#define __pyx_n_u_replace __pyx_string_tab[162] +#define __pyx_n_u_replace_params __pyx_string_tab[163] +#define __pyx_n_u_replace_params_split __pyx_string_tab[164] +#define __pyx_n_u_res __pyx_string_tab[165] +#define __pyx_n_u_restriction __pyx_string_tab[166] +#define __pyx_n_u_restrictions __pyx_string_tab[167] +#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[168] +#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[169] +#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[170] +#define __pyx_n_u_return __pyx_string_tab[171] +#define __pyx_n_u_right __pyx_string_tab[172] +#define __pyx_n_u_right_num __pyx_string_tab[173] +#define __pyx_n_u_right_remainder __pyx_string_tab[174] +#define __pyx_n_u_right_swap __pyx_string_tab[175] +#define __pyx_n_u_s __pyx_string_tab[176] +#define __pyx_n_u_search __pyx_string_tab[177] +#define __pyx_n_u_send __pyx_string_tab[178] +#define __pyx_n_u_set_name __pyx_string_tab[179] +#define __pyx_n_u_setdefault __pyx_string_tab[180] +#define __pyx_n_u_split __pyx_string_tab[181] +#define __pyx_n_u_split_restrictions __pyx_string_tab[182] +#define __pyx_n_u_splitted __pyx_string_tab[183] +#define __pyx_n_u_start __pyx_string_tab[184] +#define __pyx_n_u_str __pyx_string_tab[185] +#define __pyx_n_u_strip __pyx_string_tab[186] +#define __pyx_n_u_sub __pyx_string_tab[187] +#define __pyx_n_u_swapped_side_first_component __pyx_string_tab[188] +#define __pyx_n_u_temp_copy __pyx_string_tab[189] +#define __pyx_n_u_test __pyx_string_tab[190] +#define __pyx_n_u_throw __pyx_string_tab[191] +#define __pyx_n_u_to_equality_constraint __pyx_string_tab[192] +#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[193] +#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[194] +#define __pyx_n_u_tune_params __pyx_string_tab[195] +#define __pyx_n_u_types __pyx_string_tab[196] +#define __pyx_n_u_union __pyx_string_tab[197] +#define __pyx_n_u_unique_operators __pyx_string_tab[198] +#define __pyx_n_u_unique_operators_left __pyx_string_tab[199] +#define __pyx_n_u_unique_operators_right __pyx_string_tab[200] +#define __pyx_n_u_v __pyx_string_tab[201] +#define __pyx_n_u_value __pyx_string_tab[202] +#define __pyx_n_u_values __pyx_string_tab[203] +#define __pyx_n_u_var __pyx_string_tab[204] +#define __pyx_n_u_variable_operators_left __pyx_string_tab[205] +#define __pyx_n_u_variable_operators_right __pyx_string_tab[206] +#define __pyx_n_u_variable_supported_operators __pyx_string_tab[207] +#define __pyx_n_u_variable_unique_operators __pyx_string_tab[208] +#define __pyx_n_u_variables __pyx_string_tab[209] +#define __pyx_n_u_variables_on_left __pyx_string_tab[210] +#define __pyx_kp_b_iso88591_1 __pyx_string_tab[211] +#define __pyx_kp_b_iso88591_1_2 __pyx_string_tab[212] +#define __pyx_kp_b_iso88591_A_3axs_Qa_1_2XQfA_Rxq_a_5_AS_2S __pyx_string_tab[213] +#define __pyx_kp_b_iso88591_A_l_4s_Cq_2V2Q_1 __pyx_string_tab[214] +#define __pyx_kp_b_iso88591_A_l_4s_Cq_t1A_1_1 __pyx_string_tab[215] +#define __pyx_kp_b_iso88591_HA_4vRxq_Q_a_b_1AV3d_q __pyx_string_tab[216] +#define __pyx_kp_b_iso88591_Q __pyx_string_tab[217] +#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[218] +#define __pyx_kp_b_iso88591_Q_G1_xs_c_1_6_uA_AV1D_Qd_e2YasR __pyx_string_tab[219] +#define __pyx_kp_b_iso88591_V1_A_Oq__A_Qm1_q_9_gQm_q_1Kz_gQ __pyx_string_tab[220] +#define __pyx_kp_b_iso88591_XQ_Qa_z_5_q_q __pyx_string_tab[221] +#define __pyx_kp_b_iso88591_Ya_1_q_Q2_m5_ar_U_6_Q_q_t4uA_d __pyx_string_tab[222] +#define __pyx_kp_b_iso88591__25 __pyx_string_tab[223] +#define __pyx_kp_b_iso88591__26 __pyx_string_tab[224] +#define __pyx_kp_b_iso88591__27 __pyx_string_tab[225] +#define __pyx_kp_b_iso88591__28 __pyx_string_tab[226] +#define __pyx_kp_b_iso88591_a_3axs_C_1_avV6_a_Bhas_q_a_3a_Q __pyx_string_tab[227] +#define __pyx_kp_b_iso88591_q __pyx_string_tab[228] +#define __pyx_kp_b_iso88591_q_2 __pyx_string_tab[229] +#define __pyx_int_0 __pyx_number_tab[0] +#define __pyx_int_neg_1 __pyx_number_tab[1] +#define __pyx_int_1 __pyx_number_tab[2] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3465,12 +3418,6 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif #if CYTHON_PEP489_MULTI_PHASE_INIT __Pyx_State_RemoveModule(NULL); #endif @@ -3496,20 +3443,31 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint); - Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr); for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } - for (int i=0; i<19; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<205; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } - Py_CLEAR(clear_module_state->__pyx_int_0); - Py_CLEAR(clear_module_state->__pyx_int_1); - Py_CLEAR(clear_module_state->__pyx_int_neg_1); - return 0; + for (int i=0; i<21; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<230; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); } +/* #### Code section: module_state_clear_contents ### */ +/* CommonTypesMetaclass.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType); + +/* CythonFunctionShared.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + +/* Generator.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_GeneratorType); + +/* #### Code section: module_state_clear_end ### */ +return 0; } #endif /* #### Code section: module_state_traverse ### */ @@ -3523,12 +3481,6 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); - #endif Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions); Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint); @@ -3551,29 +3503,40 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint); - Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr); for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } - for (int i=0; i<19; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<205; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_neg_1); - return 0; + for (int i=0; i<21; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<230; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); } +/* #### Code section: module_state_traverse_contents ### */ +/* CommonTypesMetaclass.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType); + +/* CythonFunctionShared.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + +/* Generator.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_GeneratorType); + +/* #### Code section: module_state_traverse_end ### */ +return 0; } #endif /* #### Code section: module_code ### */ -/* "constraint/parser.py":30 - * ) +/* "constraint/parser.py":32 * - * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< - * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 + * + * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Constraint | str, list[str]]]: # <<<<<<<<<<<<<< + * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 * # rewrite the restrictions so variables are singled out */ @@ -3618,39 +3581,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_restrictions,&__pyx_mstate_global->__pyx_n_u_tune_params,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 30, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 32, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 30, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 32, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 30, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 32, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "parse_restrictions", 0) < 0) __PYX_ERR(0, 30, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "parse_restrictions", 0) < (0)) __PYX_ERR(0, 32, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parse_restrictions", 1, 2, 2, i); __PYX_ERR(0, 30, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parse_restrictions", 1, 2, 2, i); __PYX_ERR(0, 32, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 30, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 32, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 30, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 32, __pyx_L3_error) } __pyx_v_restrictions = ((PyObject*)values[0]); __pyx_v_tune_params = ((PyObject*)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("parse_restrictions", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 30, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("parse_restrictions", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 32, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3661,8 +3624,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 2))) __PYX_ERR(0, 30, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tune_params), (&PyDict_Type), 0, "tune_params", 2))) __PYX_ERR(0, 30, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 2))) __PYX_ERR(0, 32, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tune_params), (&PyDict_Type), 0, "tune_params", 2))) __PYX_ERR(0, 32, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_parse_restrictions(__pyx_self, __pyx_v_restrictions, __pyx_v_tune_params); /* function exit code */ @@ -3682,7 +3645,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "constraint/parser.py":36 +/* "constraint/parser.py":38 * regex_match_variable_or_constant = r"([a-zA-Z_$0-9]*)" * * def replace_params(match_object): # <<<<<<<<<<<<<< @@ -3729,32 +3692,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_match_object,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 36, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 38, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 36, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 38, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "replace_params", 0) < 0) __PYX_ERR(0, 36, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "replace_params", 0) < (0)) __PYX_ERR(0, 38, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("replace_params", 1, 1, 1, i); __PYX_ERR(0, 36, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("replace_params", 1, 1, 1, i); __PYX_ERR(0, 38, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 36, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 38, __pyx_L3_error) } __pyx_v_match_object = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("replace_params", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 36, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("replace_params", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 38, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3793,7 +3756,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para __pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "constraint/parser.py":37 + /* "constraint/parser.py":39 * * def replace_params(match_object): * key = match_object.group(1) # <<<<<<<<<<<<<< @@ -3805,42 +3768,42 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_1}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":38 + /* "constraint/parser.py":40 * def replace_params(match_object): * key = match_object.group(1) * if key in tune_params: # <<<<<<<<<<<<<< * param = str(key) * return "params[params_index['" + param + "']]" */ - if (unlikely(!__pyx_cur_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 38, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 40, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_v_tune_params == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 38, __pyx_L1_error) + __PYX_ERR(0, 40, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_key, __pyx_cur_scope->__pyx_v_tune_params, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_key, __pyx_cur_scope->__pyx_v_tune_params, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 40, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/parser.py":39 + /* "constraint/parser.py":41 * key = match_object.group(1) * if key in tune_params: * param = str(key) # <<<<<<<<<<<<<< * return "params[params_index['" + param + "']]" * else: */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_param = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":40 + /* "constraint/parser.py":42 * if key in tune_params: * param = str(key) * return "params[params_index['" + param + "']]" # <<<<<<<<<<<<<< @@ -3848,16 +3811,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para * return key */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_params_params_index, __pyx_v_param); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_params_params_index, __pyx_v_param); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/parser.py":38 + /* "constraint/parser.py":40 * def replace_params(match_object): * key = match_object.group(1) * if key in tune_params: # <<<<<<<<<<<<<< @@ -3866,7 +3829,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para */ } - /* "constraint/parser.py":42 + /* "constraint/parser.py":44 * return "params[params_index['" + param + "']]" * else: * return key # <<<<<<<<<<<<<< @@ -3880,7 +3843,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para goto __pyx_L0; } - /* "constraint/parser.py":36 + /* "constraint/parser.py":38 * regex_match_variable_or_constant = r"([a-zA-Z_$0-9]*)" * * def replace_params(match_object): # <<<<<<<<<<<<<< @@ -3902,7 +3865,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para return __pyx_r; } -/* "constraint/parser.py":44 +/* "constraint/parser.py":46 * return key * * def replace_params_split(match_object): # <<<<<<<<<<<<<< @@ -3949,32 +3912,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_match_object,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 44, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 46, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 44, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 46, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "replace_params_split", 0) < 0) __PYX_ERR(0, 44, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "replace_params_split", 0) < (0)) __PYX_ERR(0, 46, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("replace_params_split", 1, 1, 1, i); __PYX_ERR(0, 44, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("replace_params_split", 1, 1, 1, i); __PYX_ERR(0, 46, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 44, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 46, __pyx_L3_error) } __pyx_v_match_object = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("replace_params_split", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 44, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("replace_params_split", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 46, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4014,7 +3977,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par __pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "constraint/parser.py":46 + /* "constraint/parser.py":48 * def replace_params_split(match_object): * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) # <<<<<<<<<<<<<< @@ -4026,56 +3989,56 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_1}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":47 + /* "constraint/parser.py":49 * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) * if key in tune_params: # <<<<<<<<<<<<<< * param = str(key) * params_used.add(param) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 47, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 49, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_v_tune_params == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 47, __pyx_L1_error) + __PYX_ERR(0, 49, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_key, __pyx_cur_scope->__pyx_v_tune_params, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_key, __pyx_cur_scope->__pyx_v_tune_params, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 49, __pyx_L1_error) if (__pyx_t_4) { - /* "constraint/parser.py":48 + /* "constraint/parser.py":50 * key = match_object.group(1) * if key in tune_params: * param = str(key) # <<<<<<<<<<<<<< * params_used.add(param) * return param */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_param = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":49 + /* "constraint/parser.py":51 * if key in tune_params: * param = str(key) * params_used.add(param) # <<<<<<<<<<<<<< * return param * else: */ - if (unlikely(!__pyx_cur_scope->__pyx_v_params_used)) { __Pyx_RaiseClosureNameError("params_used"); __PYX_ERR(0, 49, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_params_used)) { __Pyx_RaiseClosureNameError("params_used"); __PYX_ERR(0, 51, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_v_params_used == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); - __PYX_ERR(0, 49, __pyx_L1_error) + __PYX_ERR(0, 51, __pyx_L1_error) } - __pyx_t_5 = PySet_Add(__pyx_cur_scope->__pyx_v_params_used, __pyx_v_param); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_5 = PySet_Add(__pyx_cur_scope->__pyx_v_params_used, __pyx_v_param); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 51, __pyx_L1_error) - /* "constraint/parser.py":50 + /* "constraint/parser.py":52 * param = str(key) * params_used.add(param) * return param # <<<<<<<<<<<<<< @@ -4087,7 +4050,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par __pyx_r = __pyx_v_param; goto __pyx_L0; - /* "constraint/parser.py":47 + /* "constraint/parser.py":49 * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) * if key in tune_params: # <<<<<<<<<<<<<< @@ -4096,7 +4059,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par */ } - /* "constraint/parser.py":52 + /* "constraint/parser.py":54 * return param * else: * return key # <<<<<<<<<<<<<< @@ -4110,7 +4073,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par goto __pyx_L0; } - /* "constraint/parser.py":44 + /* "constraint/parser.py":46 * return key * * def replace_params_split(match_object): # <<<<<<<<<<<<<< @@ -4132,7 +4095,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par return __pyx_r; } -/* "constraint/parser.py":54 +/* "constraint/parser.py":56 * return key * * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: # <<<<<<<<<<<<<< @@ -4180,32 +4143,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_restrictions,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 54, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 56, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 54, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 56, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "to_multiple_restrictions", 0) < 0) __PYX_ERR(0, 54, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "to_multiple_restrictions", 0) < (0)) __PYX_ERR(0, 56, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_multiple_restrictions", 1, 1, 1, i); __PYX_ERR(0, 54, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_multiple_restrictions", 1, 1, 1, i); __PYX_ERR(0, 56, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 54, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 56, __pyx_L3_error) } __pyx_v_restrictions = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("to_multiple_restrictions", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 54, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_multiple_restrictions", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 56, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4216,7 +4179,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 2))) __PYX_ERR(0, 54, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 2))) __PYX_ERR(0, 56, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple_restrictions(__pyx_self, __pyx_v_restrictions); /* function exit code */ @@ -4261,25 +4224,24 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple size_t __pyx_t_11; Py_ssize_t __pyx_t_12; PyObject *(*__pyx_t_13)(PyObject *); - Py_ssize_t __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_multiple_restrictions", 0); - /* "constraint/parser.py":56 + /* "constraint/parser.py":58 * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: * """Split the restrictions into multiple restriction where possible (e.g. 3 <= x * y < 9 <= z -> [(MinProd(3), [x, y]), (MaxProd(9-1), [x, y]), (MinProd(9), [z])]).""" # noqa: E501 * split_restrictions = list() # <<<<<<<<<<<<<< * for res in restrictions: * # if there are logic chains in the restriction, skip splitting further */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_split_restrictions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":57 + /* "constraint/parser.py":59 * """Split the restrictions into multiple restriction where possible (e.g. 3 <= x * y < 9 <= z -> [(MinProd(3), [x, y]), (MaxProd(9-1), [x, y]), (MinProd(9), [z])]).""" # noqa: E501 * split_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -4292,45 +4254,45 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 57, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 59, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":59 + /* "constraint/parser.py":61 * for res in restrictions: * # if there are logic chains in the restriction, skip splitting further * if " and " in res or " or " in res: # <<<<<<<<<<<<<< * split_restrictions.append(res) * continue */ - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u_and, __pyx_v_res, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u_and, __pyx_v_res, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 61, __pyx_L1_error) if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L6_bool_binop_done; } - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u_or, __pyx_v_res, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 59, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u_or, __pyx_v_res, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 61, __pyx_L1_error) __pyx_t_4 = __pyx_t_5; __pyx_L6_bool_binop_done:; if (__pyx_t_4) { - /* "constraint/parser.py":60 + /* "constraint/parser.py":62 * # if there are logic chains in the restriction, skip splitting further * if " and " in res or " or " in res: * split_restrictions.append(res) # <<<<<<<<<<<<<< * continue * # find the indices of splittable comparators */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_split_restrictions, __pyx_v_res); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_split_restrictions, __pyx_v_res); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 62, __pyx_L1_error) - /* "constraint/parser.py":61 + /* "constraint/parser.py":63 * if " and " in res or " or " in res: * split_restrictions.append(res) * continue # <<<<<<<<<<<<<< @@ -4339,7 +4301,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ goto __pyx_L3_continue; - /* "constraint/parser.py":59 + /* "constraint/parser.py":61 * for res in restrictions: * # if there are logic chains in the restriction, skip splitting further * if " and " in res or " or " in res: # <<<<<<<<<<<<<< @@ -4348,31 +4310,31 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ } - /* "constraint/parser.py":63 + /* "constraint/parser.py":65 * continue * # find the indices of splittable comparators * comparators = ["<=", ">=", ">", "<"] # <<<<<<<<<<<<<< * comparators_indices = [(m.start(0), m.end(0)) for m in re.finditer("|".join(comparators), res)] * if len(comparators_indices) <= 1: */ - __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__2); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 63, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 65, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__3); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 63, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 65, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__4); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 63, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 65, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__5); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 63, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 65, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_comparators, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "constraint/parser.py":64 + /* "constraint/parser.py":66 * # find the indices of splittable comparators * comparators = ["<=", ">=", ">", "<"] * comparators_indices = [(m.start(0), m.end(0)) for m in re.finditer("|".join(comparators), res)] # <<<<<<<<<<<<<< @@ -4380,15 +4342,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * # this can't be split further */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L10_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 64, __pyx_L10_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_finditer); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L10_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_finditer); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 64, __pyx_L10_error) + __pyx_t_9 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS @@ -4404,11 +4366,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_9, __pyx_v_res}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 64, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 66, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); } if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { @@ -4416,9 +4378,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L10_error) + __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 64, __pyx_L10_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 66, __pyx_L10_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { @@ -4427,17 +4389,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 64, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 66, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_12); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 64, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 66, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } @@ -4448,13 +4410,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple #endif ++__pyx_t_12; } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 64, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 66, __pyx_L10_error) } else { __pyx_t_7 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 64, __pyx_L10_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 66, __pyx_L10_error) PyErr_Clear(); } break; @@ -4468,9 +4430,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_int_0}; - __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_start, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_start, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 64, __pyx_L10_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 66, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_8 = __pyx_7genexpr__pyx_v_m; @@ -4478,20 +4440,20 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_int_0}; - __pyx_t_9 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_end, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_end, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 64, __pyx_L10_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); } - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L10_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 64, __pyx_L10_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 66, __pyx_L10_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 64, __pyx_L10_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 66, __pyx_L10_error); __pyx_t_7 = 0; __pyx_t_9 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 64, __pyx_L10_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 66, __pyx_L10_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -4505,27 +4467,27 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __Pyx_XDECREF_SET(__pyx_v_comparators_indices, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "constraint/parser.py":65 + /* "constraint/parser.py":67 * comparators = ["<=", ">=", ">", "<"] * comparators_indices = [(m.start(0), m.end(0)) for m in re.finditer("|".join(comparators), res)] * if len(comparators_indices) <= 1: # <<<<<<<<<<<<<< * # this can't be split further * split_restrictions.append(res) */ - __pyx_t_12 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_t_4 = (__pyx_t_12 <= 1); if (__pyx_t_4) { - /* "constraint/parser.py":67 + /* "constraint/parser.py":69 * if len(comparators_indices) <= 1: * # this can't be split further * split_restrictions.append(res) # <<<<<<<<<<<<<< * continue * # split the restrictions from the previous to the next comparator */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_split_restrictions, __pyx_v_res); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_split_restrictions, __pyx_v_res); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 69, __pyx_L1_error) - /* "constraint/parser.py":68 + /* "constraint/parser.py":70 * # this can't be split further * split_restrictions.append(res) * continue # <<<<<<<<<<<<<< @@ -4534,7 +4496,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ goto __pyx_L3_continue; - /* "constraint/parser.py":65 + /* "constraint/parser.py":67 * comparators = ["<=", ">=", ">", "<"] * comparators_indices = [(m.start(0), m.end(0)) for m in re.finditer("|".join(comparators), res)] * if len(comparators_indices) <= 1: # <<<<<<<<<<<<<< @@ -4543,7 +4505,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple */ } - /* "constraint/parser.py":70 + /* "constraint/parser.py":72 * continue * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): # <<<<<<<<<<<<<< @@ -4551,65 +4513,29 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * prev_stop = comparators_indices[index - 1][1] + 1 if index > 0 else 0 */ __pyx_t_10 = NULL; - __Pyx_INCREF(__pyx_builtin_range); - __pyx_t_8 = __pyx_builtin_range; - __pyx_t_12 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 70, __pyx_L1_error) - __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_8 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_8}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); - __pyx_t_12 = 0; - __pyx_t_13 = NULL; - } else { - __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 70, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 70, __pyx_L1_error) - } + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { - if (likely(!__pyx_t_13)) { - if (likely(PyList_CheckExact(__pyx_t_8))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 70, __pyx_L1_error) - #endif - if (__pyx_t_12 >= __pyx_temp) break; - } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_12); - ++__pyx_t_12; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 70, __pyx_L1_error) - #endif - if (__pyx_t_12 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12)); - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_12); - #endif - ++__pyx_t_12; - } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) - } else { + { __pyx_t_3 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 70, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 72, __pyx_L1_error) PyErr_Clear(); } break; @@ -4619,7 +4545,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":71 + /* "constraint/parser.py":73 * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): * temp_copy = res # <<<<<<<<<<<<<< @@ -4629,30 +4555,30 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __Pyx_INCREF(__pyx_v_res); __Pyx_XDECREF_SET(__pyx_v_temp_copy, __pyx_v_res); - /* "constraint/parser.py":72 + /* "constraint/parser.py":74 * for index in range(len(comparators_indices)): * temp_copy = res * prev_stop = comparators_indices[index - 1][1] + 1 if index > 0 else 0 # <<<<<<<<<<<<<< * next_stop = ( * comparators_indices[index + 1][0] if index < len(comparators_indices) - 1 else len(temp_copy) */ - __pyx_t_9 = PyObject_RichCompare(__pyx_v_index, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_10 = PyObject_RichCompare(__pyx_v_index, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_4) { - __pyx_t_9 = __Pyx_PyLong_SubtractObjC(__pyx_v_index, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_comparators_indices, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyLong_SubtractObjC(__pyx_v_index, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_10, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_comparators_indices, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyLong_AddObjC(__pyx_t_9, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_3 = __pyx_t_10; - __pyx_t_10 = 0; + __pyx_t_9 = __Pyx_PyLong_AddObjC(__pyx_t_10, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 74, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_3 = __pyx_t_9; + __pyx_t_9 = 0; } else { __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); __pyx_t_3 = __pyx_mstate_global->__pyx_int_0; @@ -4660,65 +4586,65 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __Pyx_XDECREF_SET(__pyx_v_prev_stop, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":74 + /* "constraint/parser.py":76 * prev_stop = comparators_indices[index - 1][1] + 1 if index > 0 else 0 * next_stop = ( * comparators_indices[index + 1][0] if index < len(comparators_indices) - 1 else len(temp_copy) # <<<<<<<<<<<<<< * ) * split_restrictions.append(temp_copy[prev_stop:next_stop].strip()) */ - __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 74, __pyx_L1_error) - __pyx_t_10 = PyLong_FromSsize_t((__pyx_t_14 - 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 74, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = PyObject_RichCompare(__pyx_v_index, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 74, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_9 = PyLong_FromSsize_t((__pyx_t_12 - 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyObject_RichCompare(__pyx_v_index, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_4) { - __pyx_t_9 = __Pyx_PyLong_AddObjC(__pyx_v_index, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 74, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_comparators_indices, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyLong_AddObjC(__pyx_v_index, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_comparators_indices, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_3 = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_3 = __pyx_t_10; + __pyx_t_10 = 0; } else { - __pyx_t_14 = PyObject_Length(__pyx_v_temp_copy); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 74, __pyx_L1_error) - __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 74, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_12 = PyObject_Length(__pyx_v_temp_copy); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_10 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __pyx_t_10; + __pyx_t_10 = 0; } __Pyx_XDECREF_SET(__pyx_v_next_stop, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":76 + /* "constraint/parser.py":78 * comparators_indices[index + 1][0] if index < len(comparators_indices) - 1 else len(temp_copy) * ) * split_restrictions.append(temp_copy[prev_stop:next_stop].strip()) # <<<<<<<<<<<<<< * return split_restrictions * */ - __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_v_temp_copy, 0, 0, &__pyx_v_prev_stop, &__pyx_v_next_stop, NULL, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __pyx_t_10; - __Pyx_INCREF(__pyx_t_9); + __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_temp_copy, 0, 0, &__pyx_v_prev_stop, &__pyx_v_next_stop, NULL, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __pyx_t_9; + __Pyx_INCREF(__pyx_t_10); __pyx_t_11 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL}; + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_split_restrictions, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_split_restrictions, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":70 + /* "constraint/parser.py":72 * continue * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): # <<<<<<<<<<<<<< @@ -4728,7 +4654,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":57 + /* "constraint/parser.py":59 * """Split the restrictions into multiple restriction where possible (e.g. 3 <= x * y < 9 <= z -> [(MinProd(3), [x, y]), (MaxProd(9-1), [x, y]), (MinProd(9), [z])]).""" # noqa: E501 * split_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -4739,19 +4665,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":77 + /* "constraint/parser.py":79 * ) * split_restrictions.append(temp_copy[prev_stop:next_stop].strip()) * return split_restrictions # <<<<<<<<<<<<<< * - * def to_numeric_constraint( + * def to_numeric_constraint(restriction: str, params: list[str]) -> MinSumConstraint | VariableMinSumConstraint | ExactSumConstraint | VariableExactSumConstraint | MaxSumConstraint | VariableMaxSumConstraint | MinProdConstraint | VariableMinProdConstraint | ExactProdConstraint | VariableExactProdConstraint | MaxProdConstraint | VariableMaxProdConstraint | None: # noqa: E501 */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_split_restrictions); __pyx_r = __pyx_v_split_restrictions; goto __pyx_L0; - /* "constraint/parser.py":54 + /* "constraint/parser.py":56 * return key * * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: # <<<<<<<<<<<<<< @@ -4784,12 +4710,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple return __pyx_r; } -/* "constraint/parser.py":79 +/* "constraint/parser.py":81 * return split_restrictions * - * def to_numeric_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]: # noqa: E501 + * def to_numeric_constraint(restriction: str, params: list[str]) -> MinSumConstraint | VariableMinSumConstraint | ExactSumConstraint | VariableExactSumConstraint | MaxSumConstraint | VariableMaxSumConstraint | MinProdConstraint | VariableMinProdConstraint | ExactProdConstraint | VariableExactProdConstraint | MaxProdConstraint | VariableMaxProdConstraint | None: # noqa: E501 # <<<<<<<<<<<<<< + * """Converts a restriction to a built-in numeric constraint if possible.""" + * # first check if all parameters have only numbers as values */ /* Python wrapper */ @@ -4833,39 +4759,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_restriction,&__pyx_mstate_global->__pyx_n_u_params,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 79, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 81, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 79, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 81, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 79, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 81, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "to_numeric_constraint", 0) < 0) __PYX_ERR(0, 79, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "to_numeric_constraint", 0) < (0)) __PYX_ERR(0, 81, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_numeric_constraint", 1, 2, 2, i); __PYX_ERR(0, 79, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_numeric_constraint", 1, 2, 2, i); __PYX_ERR(0, 81, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 79, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 81, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 79, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 81, __pyx_L3_error) } __pyx_v_restriction = ((PyObject*)values[0]); __pyx_v_params = ((PyObject*)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("to_numeric_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 79, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_numeric_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 81, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4876,8 +4802,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 80, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 80, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 81, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 81, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(__pyx_self, __pyx_v_restriction, __pyx_v_params); /* function exit code */ @@ -4896,339 +4822,36 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":148 +/* "constraint/parser.py":84 + * """Converts a restriction to a built-in numeric constraint if possible.""" + * # first check if all parameters have only numbers as values + * if len(params) == 0 or not all(all(isinstance(v, (int, float)) for v in tune_params[p]) for p in params): # <<<<<<<<<<<<<< + * return None * - * # find out which side is the constant number - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< - * try: - * # check if it's a number or solvable to a number (e.g. '32*2') */ -/* Python wrapper */ -static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_1is_or_evals_to_number(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_1is_or_evals_to_number = {"is_or_evals_to_number", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_1is_or_evals_to_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_1is_or_evals_to_number(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_s = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("is_or_evals_to_number (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_SIZE - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s,0}; - const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 148, __pyx_L3_error) - if (__pyx_kwds_len > 0) { - switch (__pyx_nargs) { - case 1: - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 148, __pyx_L3_error) - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "is_or_evals_to_number", 0) < 0) __PYX_ERR(0, 148, __pyx_L3_error) - for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_or_evals_to_number", 1, 1, 1, i); __PYX_ERR(0, 148, __pyx_L3_error) } - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 148, __pyx_L3_error) - } - __pyx_v_s = ((PyObject*)values[0]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("is_or_evals_to_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 148, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_numeric_constraint.is_or_evals_to_number", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PyUnicode_Type), 0, "s", 2))) __PYX_ERR(0, 148, __pyx_L1_error) - __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_self, __pyx_v_s); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - goto __pyx_L7_cleaned_up; - __pyx_L0:; - for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - Py_XDECREF(values[__pyx_temp]); - } - __pyx_L7_cleaned_up:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { - PyObject *__pyx_v_number = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - size_t __pyx_t_9; - int __pyx_t_10; - int __pyx_t_11; - int __pyx_t_12; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("is_or_evals_to_number", 0); - - /* "constraint/parser.py":149 - * # find out which side is the constant number - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: - * try: # <<<<<<<<<<<<<< - * # check if it's a number or solvable to a number (e.g. '32*2') - * number = eval(s) -*/ - { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "constraint/parser.py":151 - * try: - * # check if it's a number or solvable to a number (e.g. '32*2') - * number = eval(s) # <<<<<<<<<<<<<< - * assert isinstance(number, (int, float)) - * return number -*/ - __pyx_t_5 = NULL; - __Pyx_INCREF(__pyx_builtin_eval); - __pyx_t_6 = __pyx_builtin_eval; - __pyx_t_7 = __Pyx_Globals(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 151, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 151, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_8); - if (__pyx_v_number) { - if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_number, __pyx_v_number) < 0) __PYX_ERR(0, 151, __pyx_L3_error) - } - if (__pyx_v_s) { - if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_s, __pyx_v_s) < 0) __PYX_ERR(0, 151, __pyx_L3_error) - } - __pyx_t_9 = 1; - { - PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_s, __pyx_t_7, __pyx_t_8}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L3_error) - __Pyx_GOTREF(__pyx_t_4); - } - __pyx_v_number = __pyx_t_4; - __pyx_t_4 = 0; - - /* "constraint/parser.py":152 - * # check if it's a number or solvable to a number (e.g. '32*2') - * number = eval(s) - * assert isinstance(number, (int, float)) # <<<<<<<<<<<<<< - * return number - * except Exception: -*/ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_11 = PyLong_Check(__pyx_v_number); - if (!__pyx_t_11) { - } else { - __pyx_t_10 = __pyx_t_11; - goto __pyx_L9_bool_binop_done; - } - __pyx_t_11 = PyFloat_Check(__pyx_v_number); - __pyx_t_10 = __pyx_t_11; - __pyx_L9_bool_binop_done:; - if (unlikely(!__pyx_t_10)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 152, __pyx_L3_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 152, __pyx_L3_error) - #endif - - /* "constraint/parser.py":153 - * number = eval(s) - * assert isinstance(number, (int, float)) - * return number # <<<<<<<<<<<<<< - * except Exception: - * # it's not a solvable subexpression, return None -*/ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_number); - __pyx_r = __pyx_v_number; - goto __pyx_L7_try_return; - - /* "constraint/parser.py":149 - * # find out which side is the constant number - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: - * try: # <<<<<<<<<<<<<< - * # check if it's a number or solvable to a number (e.g. '32*2') - * number = eval(s) -*/ - } - __pyx_L3_error:; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "constraint/parser.py":154 - * assert isinstance(number, (int, float)) - * return number - * except Exception: # <<<<<<<<<<<<<< - * # it's not a solvable subexpression, return None - * return None -*/ - __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); - if (__pyx_t_12) { - __Pyx_ErrRestore(0,0,0); - - /* "constraint/parser.py":156 - * except Exception: - * # it's not a solvable subexpression, return None - * return None # <<<<<<<<<<<<<< - * - * # either the left or right side of the equation must evaluate to a constant number, otherwise we use a VariableConstraint # noqa: E501 -*/ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L6_except_return; - } - goto __pyx_L5_except_error; - - /* "constraint/parser.py":149 - * # find out which side is the constant number - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: - * try: # <<<<<<<<<<<<<< - * # check if it's a number or solvable to a number (e.g. '32*2') - * number = eval(s) -*/ - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L7_try_return:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L0; - __pyx_L6_except_return:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L0; - } - - /* "constraint/parser.py":148 - * - * # find out which side is the constant number - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< - * try: - * # check if it's a number or solvable to a number (e.g. '32*2') -*/ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_numeric_constraint.is_or_evals_to_number", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_number); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_4generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "constraint/parser.py":84 - * """Converts a restriction to a built-in numeric constraint if possible.""" - * # first check if all parameters have only numbers as values - * if len(params) == 0 or not all(all(isinstance(v, (int, float)) for v in tune_params[p]) for p in params): # <<<<<<<<<<<<<< - * return None - * -*/ - -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 84, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; - __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 84, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_2generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); @@ -5289,7 +4912,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -5370,7 +4993,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *__pyx_cur_scope; PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7genexpr_2generator1 = 0; PyObject *__pyx_r = NULL; @@ -5394,7 +5017,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_4generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5411,7 +5034,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_4generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; @@ -5445,7 +5068,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -5506,7 +5129,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "constraint/parser.py":95 * @@ -5516,7 +5139,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * # if we have an inverse operation, rewrite to the other side */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0, PyObject *__pyx_genexpr_arg_1) { +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0, PyObject *__pyx_genexpr_arg_1) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5539,7 +5162,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_1); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_1); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5555,7 +5178,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; @@ -5583,7 +5206,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 95, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 95, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_Split(__pyx_cur_scope->__pyx_genexpr_arg_0, __Pyx_NoneAsNull(__pyx_cur_scope->__pyx_genexpr_arg_1), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_cur_scope->__pyx_genexpr_arg_0, __Pyx_NoneAsNull(__pyx_cur_scope->__pyx_genexpr_arg_1), -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5596,7 +5219,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5609,7 +5232,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5656,17 +5279,17 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "constraint/parser.py":140 * * # we have a potentially rewritten restriction, split again * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< - * operators_left = [s.strip() for s in list(left) if s in supported_operators] - * operators_right = [s.strip() for s in list(right) if s in supported_operators] + * operators_left = extract_operators(left) + * operators_right = extract_operators(right) */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0, PyObject *__pyx_genexpr_arg_1) { +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_6genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0, PyObject *__pyx_genexpr_arg_1) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5689,7 +5312,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_1); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_1); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator3, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8generator3, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5705,7 +5328,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; @@ -5733,7 +5356,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 140, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 140, __pyx_L1_error) } - __pyx_t_1 = PyUnicode_Split(__pyx_cur_scope->__pyx_genexpr_arg_0, __Pyx_NoneAsNull(__pyx_cur_scope->__pyx_genexpr_arg_1), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Split(__pyx_cur_scope->__pyx_genexpr_arg_0, __Pyx_NoneAsNull(__pyx_cur_scope->__pyx_genexpr_arg_1), -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -5746,7 +5369,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5759,7 +5382,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5806,17 +5429,17 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":168 - * - * # find all unique variable_supported_operators in the restriction, can have at most one - * variable_operators_left = list(s.strip() for s in list(left) if s in variable_supported_operators) # <<<<<<<<<<<<<< - * variable_operators_right = list(s.strip() for s in list(right) if s in variable_supported_operators) - * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) +/* "constraint/parser.py":160 + * if len(variables) == 0: + * return None + * if any(var.strip() not in tune_params for var in variables): # <<<<<<<<<<<<<< + * raise ValueError(f"Variables {variables} not in tune_params {tune_params.keys()}") + * if ( */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_9genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5828,7 +5451,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 168, __pyx_L1_error) + __PYX_ERR(0, 160, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5839,7 +5462,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator4, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11generator4, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5855,16 +5478,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; size_t __pyx_t_6; + int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5877,57 +5501,100 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 168, __pyx_L1_error) - __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 168, __pyx_L1_error) } - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 168, __pyx_L1_error) - #endif - if (__pyx_t_3 >= __pyx_temp) break; - } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); - ++__pyx_t_3; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 160, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 160, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable_supported_operators)) { __Pyx_RaiseClosureNameError("variable_supported_operators"); __PYX_ERR(0, 168, __pyx_L1_error) } - __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 168, __pyx_L1_error) - if (__pyx_t_4) { - __pyx_t_5 = __pyx_cur_scope->__pyx_v_s; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - } - if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 168, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 160, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_2; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 160, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2)); + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); + #endif + ++__pyx_t_2; + } + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + } else { + __pyx_t_4 = __pyx_t_3(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 160, __pyx_L1_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_var); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_var, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_5 = __pyx_cur_scope->__pyx_v_var; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_6 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; + __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 160, __pyx_L1_error) } + if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params == Py_None)) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); + __PYX_ERR(0, 160, __pyx_L1_error) + } + __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_outer_scope->__pyx_v_tune_params, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_7) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L0; + } + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + } + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__Pyx_PyErr_Occurred()) { __Pyx_Generator_Replace_StopIteration(0); @@ -5943,17 +5610,17 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_16generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "constraint/parser.py":169 + * * # find all unique variable_supported_operators in the restriction, can have at most one - * variable_operators_left = list(s.strip() for s in list(left) if s in variable_supported_operators) - * variable_operators_right = list(s.strip() for s in list(right) if s in variable_supported_operators) # <<<<<<<<<<<<<< + * variable_operators_left = list(s.strip() for s in list(left) if s in variable_supported_operators) # <<<<<<<<<<<<<< + * variable_operators_right = list(s.strip() for s in list(right) if s in variable_supported_operators) * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) - * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_12genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5976,7 +5643,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_16generator5, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14generator5, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5992,7 +5659,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_16generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; @@ -6031,7 +5698,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -6047,7 +5714,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -6080,17 +5747,17 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_19generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":172 +/* "constraint/parser.py":170 + * # find all unique variable_supported_operators in the restriction, can have at most one + * variable_operators_left = list(s.strip() for s in list(left) if s in variable_supported_operators) + * variable_operators_right = list(s.strip() for s in list(right) if s in variable_supported_operators) # <<<<<<<<<<<<<< * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - * if len(variable_unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0): # noqa: E501 # <<<<<<<<<<<<<< - * variables_on_left = len(unique_operators_left) > 0 - * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_15genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -6102,7 +5769,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 172, __pyx_L1_error) + __PYX_ERR(0, 170, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6113,7 +5780,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_19generator6, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17generator6, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6129,11 +5796,148 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_19generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + size_t __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 170, __pyx_L1_error) } + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 170, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_3; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable_supported_operators)) { __Pyx_RaiseClosureNameError("variable_supported_operators"); __PYX_ERR(0, 170, __pyx_L1_error) } + __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_cur_scope->__pyx_v_s, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_variable_supported_operators, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 170, __pyx_L1_error) + if (__pyx_t_4) { + __pyx_t_5 = __pyx_cur_scope->__pyx_v_s; + __Pyx_INCREF(__pyx_t_5); + __pyx_t_6 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "constraint/parser.py":175 + * if ( + * len(variable_unique_operators) <= 1 + * and all(s.strip() in params for s in variables) # <<<<<<<<<<<<<< + * and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0) + * ): # noqa: E501 +*/ + +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_18genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *__pyx_cur_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_9_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 175, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *) __pyx_self; + __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); + __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20generator7, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_numeric_constraint.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; @@ -6153,16 +5957,16 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 172, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 172, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 175, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 175, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6170,17 +5974,17 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 172, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 175, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 172, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 175, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6191,13 +5995,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 172, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 175, __pyx_L1_error) PyErr_Clear(); } break; @@ -6213,13 +6017,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 172, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 175, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { @@ -6259,9 +6063,9 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_22generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":238 +/* "constraint/parser.py":267 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -6269,19 +6073,19 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * return None */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *__pyx_cur_scope; +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_21genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_9_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 238, __pyx_L1_error) + __PYX_ERR(0, 267, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6292,7 +6096,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_22generator7, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23generator8, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6308,9 +6112,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_22generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -6330,16 +6134,16 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 238, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 238, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 267, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6347,17 +6151,17 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 238, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 238, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 267, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6368,13 +6172,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 238, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 267, __pyx_L1_error) PyErr_Clear(); } break; @@ -6385,9 +6189,9 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_o, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_operator)) { __Pyx_RaiseClosureNameError("operator"); __PYX_ERR(0, 238, __pyx_L1_error) } - __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_o, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_operator, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 238, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_operator)) { __Pyx_RaiseClosureNameError("operator"); __PYX_ERR(0, 267, __pyx_L1_error) } + __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_o, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_operator, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { @@ -6426,9 +6230,9 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_25generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":245 +/* "constraint/parser.py":274 * splitted = variables.split(operator) * # check if there are only pure, non-recurring variables (no operations or constants) in the restriction * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< @@ -6436,19 +6240,19 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * if operator == "**": */ -static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *__pyx_cur_scope; +static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_24genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 245, __pyx_L1_error) + __PYX_ERR(0, 274, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6459,7 +6263,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_25generator8, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26generator9, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6475,9 +6279,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_25generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -6499,16 +6303,16 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 245, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 245, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 274, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 274, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -6516,17 +6320,17 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 274, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 274, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -6537,13 +6341,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 274, __pyx_L1_error) PyErr_Clear(); } break; @@ -6559,13 +6363,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 245, __pyx_L1_error) } - __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 245, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 274, __pyx_L1_error) } + __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { @@ -6606,12 +6410,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return __pyx_r; } -/* "constraint/parser.py":79 +/* "constraint/parser.py":81 * return split_restrictions * - * def to_numeric_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]: # noqa: E501 + * def to_numeric_constraint(restriction: str, params: list[str]) -> MinSumConstraint | VariableMinSumConstraint | ExactSumConstraint | VariableExactSumConstraint | MaxSumConstraint | VariableMaxSumConstraint | MinProdConstraint | VariableMinProdConstraint | ExactProdConstraint | VariableExactProdConstraint | MaxProdConstraint | VariableMaxProdConstraint | None: # noqa: E501 # <<<<<<<<<<<<<< + * """Converts a restriction to a built-in numeric constraint if possible.""" + * # first check if all parameters have only numbers as values */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params) { @@ -6621,7 +6425,6 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ PyObject *__pyx_v_comparator = NULL; PyObject *__pyx_v_left = NULL; PyObject *__pyx_v_right = NULL; - PyObject *__pyx_v_supported_operators = NULL; PyObject *__pyx_v_operators_left = NULL; PyObject *__pyx_v_operators_right = NULL; PyObject *__pyx_v_unique_operators_left = NULL; @@ -6633,7 +6436,6 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ PyObject *__pyx_v_left_swap = NULL; PyObject *__pyx_v_left_remainder = NULL; PyObject *__pyx_v_right_swap = NULL; - PyObject *__pyx_v_is_or_evals_to_number = 0; PyObject *__pyx_v_left_num = NULL; PyObject *__pyx_v_right_num = NULL; PyObject *__pyx_v_variables = NULL; @@ -6645,18 +6447,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ PyObject *__pyx_v_operators = NULL; PyObject *__pyx_v_operators_found = NULL; PyObject *__pyx_v_splitted = NULL; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_4generator = 0; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator2 = 0; - PyObject *__pyx_8genexpr4__pyx_v_s = NULL; - PyObject *__pyx_8genexpr5__pyx_v_s = NULL; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator3 = 0; - PyObject *__pyx_8genexpr7__pyx_v_s = NULL; - PyObject *__pyx_8genexpr8__pyx_v_s = NULL; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator4 = 0; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_16generator5 = 0; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_19generator6 = 0; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_22generator7 = 0; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_25generator8 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2generator = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5generator2 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8generator3 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11generator4 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14generator5 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17generator6 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20generator7 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23generator8 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26generator9 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -6680,7 +6479,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 79, __pyx_L1_error) + __PYX_ERR(0, 81, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6709,7 +6508,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -6797,7 +6596,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_restriction}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -6845,7 +6644,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * * # split the string on the comparison and remove leading and trailing whitespace */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_comparators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_comparators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_comparator = __pyx_t_5; __pyx_t_5 = 0; @@ -6857,7 +6656,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * * # if we have an inverse operation, rewrite to the other side */ - __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_3genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -6891,163 +6690,90 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ /* "constraint/parser.py":98 * * # if we have an inverse operation, rewrite to the other side - * supported_operators = ["**", "*", "+", "-", "/"] # <<<<<<<<<<<<<< - * operators_left = [s.strip() for s in list(left) if s in supported_operators] - * operators_right = [s.strip() for s in list(right) if s in supported_operators] + * operators_left = extract_operators(left) # <<<<<<<<<<<<<< + * operators_right = extract_operators(right) + * if len(operators_left) > 0 and len(operators_right) > 0: */ - __pyx_t_8 = PyList_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__8); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__8); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_mstate_global->__pyx_kp_u__8) != (0)) __PYX_ERR(0, 98, __pyx_L1_error); - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__9); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__9); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_mstate_global->__pyx_kp_u__9) != (0)) __PYX_ERR(0, 98, __pyx_L1_error); - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__10); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__10); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_mstate_global->__pyx_kp_u__10) != (0)) __PYX_ERR(0, 98, __pyx_L1_error); - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__11); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__11); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 3, __pyx_mstate_global->__pyx_kp_u__11) != (0)) __PYX_ERR(0, 98, __pyx_L1_error); - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__12); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__12); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 4, __pyx_mstate_global->__pyx_kp_u__12) != (0)) __PYX_ERR(0, 98, __pyx_L1_error); - __pyx_v_supported_operators = ((PyObject*)__pyx_t_8); + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_extract_operators); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_7); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __pyx_t_9 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_left}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + } + __pyx_v_operators_left = __pyx_t_8; __pyx_t_8 = 0; /* "constraint/parser.py":99 * # if we have an inverse operation, rewrite to the other side - * supported_operators = ["**", "*", "+", "-", "/"] - * operators_left = [s.strip() for s in list(left) if s in supported_operators] # <<<<<<<<<<<<<< - * operators_right = [s.strip() for s in list(right) if s in supported_operators] - * # TODO implement the case where the minus is part of a constant, e.g. "-3 <= x + y" -*/ - { /* enter inner scope */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PySequence_List(__pyx_v_left); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 99, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); - __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 99, __pyx_L9_error) - #endif - if (__pyx_t_3 >= __pyx_temp) break; - } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_3); - ++__pyx_t_3; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 99, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_s, __pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr4__pyx_v_s, __pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 99, __pyx_L9_error) - if (__pyx_t_1) { - __pyx_t_2 = __pyx_8genexpr4__pyx_v_s; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_9 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 99, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_7); - } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 99, __pyx_L9_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_s); __pyx_8genexpr4__pyx_v_s = 0; - goto __pyx_L14_exit_scope; - __pyx_L9_error:; - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_s); __pyx_8genexpr4__pyx_v_s = 0; - goto __pyx_L1_error; - __pyx_L14_exit_scope:; - } /* exit inner scope */ - __pyx_v_operators_left = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; - - /* "constraint/parser.py":100 - * supported_operators = ["**", "*", "+", "-", "/"] - * operators_left = [s.strip() for s in list(left) if s in supported_operators] - * operators_right = [s.strip() for s in list(right) if s in supported_operators] # <<<<<<<<<<<<<< - * # TODO implement the case where the minus is part of a constant, e.g. "-3 <= x + y" + * operators_left = extract_operators(left) + * operators_right = extract_operators(right) # <<<<<<<<<<<<<< * if len(operators_left) > 0 and len(operators_right) > 0: + * # if there are operators on both sides, we can't handle this yet */ - { /* enter inner scope */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 100, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = PySequence_List(__pyx_v_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __pyx_t_5; __Pyx_INCREF(__pyx_t_7); - __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 100, __pyx_L17_error) - #endif - if (__pyx_t_3 >= __pyx_temp) break; - } - __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_3); - ++__pyx_t_3; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_s, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr5__pyx_v_s, __pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 100, __pyx_L17_error) - if (__pyx_t_1) { - __pyx_t_2 = __pyx_8genexpr5__pyx_v_s; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_9 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L17_error) - __Pyx_GOTREF(__pyx_t_5); - } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 100, __pyx_L17_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - } + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_extract_operators); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); + assert(__pyx_t_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __pyx_t_9 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_right}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_s); __pyx_8genexpr5__pyx_v_s = 0; - goto __pyx_L22_exit_scope; - __pyx_L17_error:; - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_s); __pyx_8genexpr5__pyx_v_s = 0; - goto __pyx_L1_error; - __pyx_L22_exit_scope:; - } /* exit inner scope */ - __pyx_v_operators_right = ((PyObject*)__pyx_t_8); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + } + __pyx_v_operators_right = __pyx_t_8; __pyx_t_8 = 0; - /* "constraint/parser.py":102 - * operators_right = [s.strip() for s in list(right) if s in supported_operators] - * # TODO implement the case where the minus is part of a constant, e.g. "-3 <= x + y" + /* "constraint/parser.py":100 + * operators_left = extract_operators(left) + * operators_right = extract_operators(right) * if len(operators_left) > 0 and len(operators_right) > 0: # <<<<<<<<<<<<<< * # if there are operators on both sides, we can't handle this yet * return None */ - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_operators_left); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_operators_left); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 > 0); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L24_bool_binop_done; + goto __pyx_L8_bool_binop_done; } - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_operators_right); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_operators_right); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 > 0); __pyx_t_1 = __pyx_t_6; - __pyx_L24_bool_binop_done:; + __pyx_L8_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":104 + /* "constraint/parser.py":102 * if len(operators_left) > 0 and len(operators_right) > 0: * # if there are operators on both sides, we can't handle this yet * return None # <<<<<<<<<<<<<< @@ -7058,90 +6784,98 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":102 - * operators_right = [s.strip() for s in list(right) if s in supported_operators] - * # TODO implement the case where the minus is part of a constant, e.g. "-3 <= x + y" + /* "constraint/parser.py":100 + * operators_left = extract_operators(left) + * operators_right = extract_operators(right) * if len(operators_left) > 0 and len(operators_right) > 0: # <<<<<<<<<<<<<< * # if there are operators on both sides, we can't handle this yet * return None */ } - /* "constraint/parser.py":105 + /* "constraint/parser.py":103 * # if there are operators on both sides, we can't handle this yet * return None * unique_operators_left = set(operators_left) # <<<<<<<<<<<<<< * unique_operators_right = set(operators_right) * unique_operators = unique_operators_left.union(unique_operators_right) */ - __pyx_t_8 = PySet_New(__pyx_v_operators_left); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_8 = PySet_New(__pyx_v_operators_left); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_unique_operators_left = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":106 + /* "constraint/parser.py":104 * return None * unique_operators_left = set(operators_left) * unique_operators_right = set(operators_right) # <<<<<<<<<<<<<< * unique_operators = unique_operators_left.union(unique_operators_right) * if len(unique_operators) == 1: */ - __pyx_t_8 = PySet_New(__pyx_v_operators_right); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_8 = PySet_New(__pyx_v_operators_right); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_unique_operators_right = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":107 + /* "constraint/parser.py":105 * unique_operators_left = set(operators_left) * unique_operators_right = set(operators_right) * unique_operators = unique_operators_left.union(unique_operators_right) # <<<<<<<<<<<<<< * if len(unique_operators) == 1: * variables_on_left = len(unique_operators_left) > 0 */ - __pyx_t_8 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PySet_Type__union, __pyx_v_unique_operators_left, __pyx_v_unique_operators_right); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_8 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PySet_Type__union, __pyx_v_unique_operators_left, __pyx_v_unique_operators_right); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_unique_operators = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/parser.py":108 + /* "constraint/parser.py":106 * unique_operators_right = set(operators_right) * unique_operators = unique_operators_left.union(unique_operators_right) * if len(unique_operators) == 1: # <<<<<<<<<<<<<< * variables_on_left = len(unique_operators_left) > 0 - * swapped_side_first_component = re.search(regex_match_variable_or_constant, left if variables_on_left else right) # noqa: E501 + * swapped_side_first_component = re.search( */ - __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 108, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 106, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 == 1); if (__pyx_t_1) { - /* "constraint/parser.py":109 + /* "constraint/parser.py":107 * unique_operators = unique_operators_left.union(unique_operators_right) * if len(unique_operators) == 1: * variables_on_left = len(unique_operators_left) > 0 # <<<<<<<<<<<<<< - * swapped_side_first_component = re.search(regex_match_variable_or_constant, left if variables_on_left else right) # noqa: E501 - * if swapped_side_first_component is None: + * swapped_side_first_component = re.search( + * regex_match_variable_or_constant, left if variables_on_left else right */ - __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_left); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 109, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_left); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_variables_on_left = __pyx_t_8; __pyx_t_8 = 0; - /* "constraint/parser.py":110 + /* "constraint/parser.py":108 * if len(unique_operators) == 1: * variables_on_left = len(unique_operators_left) > 0 - * swapped_side_first_component = re.search(regex_match_variable_or_constant, left if variables_on_left else right) # noqa: E501 # <<<<<<<<<<<<<< - * if swapped_side_first_component is None: - * # if there is no variable on the left side, we can't handle this yet + * swapped_side_first_component = re.search( # <<<<<<<<<<<<<< + * regex_match_variable_or_constant, left if variables_on_left else right + * ) # noqa: E501 */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_search); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_search); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable_or_constant)) { __Pyx_RaiseClosureNameError("regex_match_variable_or_constant"); __PYX_ERR(0, 110, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 110, __pyx_L1_error) + + /* "constraint/parser.py":109 + * variables_on_left = len(unique_operators_left) > 0 + * swapped_side_first_component = re.search( + * regex_match_variable_or_constant, left if variables_on_left else right # <<<<<<<<<<<<<< + * ) # noqa: E501 + * if swapped_side_first_component is None: +*/ + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable_or_constant)) { __Pyx_RaiseClosureNameError("regex_match_variable_or_constant"); __PYX_ERR(0, 109, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 109, __pyx_L1_error) if (__pyx_t_1) { __Pyx_INCREF(__pyx_v_left); __pyx_t_5 = __pyx_v_left; @@ -7163,19 +6897,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable_or_constant, __pyx_t_5}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 110, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_v_swapped_side_first_component = __pyx_t_8; __pyx_t_8 = 0; /* "constraint/parser.py":111 - * variables_on_left = len(unique_operators_left) > 0 - * swapped_side_first_component = re.search(regex_match_variable_or_constant, left if variables_on_left else right) # noqa: E501 + * regex_match_variable_or_constant, left if variables_on_left else right + * ) # noqa: E501 * if swapped_side_first_component is None: # <<<<<<<<<<<<<< * # if there is no variable on the left side, we can't handle this yet * return None @@ -7195,8 +6929,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ goto __pyx_L0; /* "constraint/parser.py":111 - * variables_on_left = len(unique_operators_left) > 0 - * swapped_side_first_component = re.search(regex_match_variable_or_constant, left if variables_on_left else right) # noqa: E501 + * regex_match_variable_or_constant, left if variables_on_left else right + * ) # noqa: E501 * if swapped_side_first_component is None: # <<<<<<<<<<<<<< * # if there is no variable on the left side, we can't handle this yet * return None @@ -7216,7 +6950,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_int_0}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_group, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -7232,7 +6966,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if not variables_on_left: * # e.g. "G == B-M" becomes "G+M == B" */ - __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_mstate_global->__pyx_kp_u__11, __pyx_v_unique_operators, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_mstate_global->__pyx_kp_u__8, __pyx_v_unique_operators, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 116, __pyx_L1_error) if (__pyx_t_1) { /* "constraint/parser.py":117 @@ -7240,7 +6974,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if "-" in unique_operators: * if not variables_on_left: # <<<<<<<<<<<<<< * # e.g. "G == B-M" becomes "G+M == B" - * right_remainder = right[len(swapped_side_first_component):] + * right_remainder = right[len(swapped_side_first_component) :] */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_1); @@ -7249,7 +6983,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ /* "constraint/parser.py":119 * if not variables_on_left: * # e.g. "G == B-M" becomes "G+M == B" - * right_remainder = right[len(swapped_side_first_component):] # <<<<<<<<<<<<<< + * right_remainder = right[len(swapped_side_first_component) :] # <<<<<<<<<<<<<< * left_swap = right_remainder.replace("-", "+") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" */ @@ -7261,7 +6995,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ /* "constraint/parser.py":120 * # e.g. "G == B-M" becomes "G+M == B" - * right_remainder = right[len(swapped_side_first_component):] + * right_remainder = right[len(swapped_side_first_component) :] * left_swap = right_remainder.replace("-", "+") # <<<<<<<<<<<<<< * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" * else: @@ -7275,7 +7009,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_2 = 0; /* "constraint/parser.py":121 - * right_remainder = right[len(swapped_side_first_component):] + * right_remainder = right[len(swapped_side_first_component) :] * left_swap = right_remainder.replace("-", "+") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" # <<<<<<<<<<<<<< * else: @@ -7308,15 +7042,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if "-" in unique_operators: * if not variables_on_left: # <<<<<<<<<<<<<< * # e.g. "G == B-M" becomes "G+M == B" - * right_remainder = right[len(swapped_side_first_component):] + * right_remainder = right[len(swapped_side_first_component) :] */ - goto __pyx_L29; + goto __pyx_L13; } /* "constraint/parser.py":124 * else: * # e.g. "B-M == G" becomes "B == G+M" - * left_remainder = left[len(swapped_side_first_component):] # <<<<<<<<<<<<<< + * left_remainder = left[len(swapped_side_first_component) :] # <<<<<<<<<<<<<< * right_swap = left_remainder.replace("-", "+") * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" */ @@ -7329,7 +7063,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ /* "constraint/parser.py":125 * # e.g. "B-M == G" becomes "B == G+M" - * left_remainder = left[len(swapped_side_first_component):] + * left_remainder = left[len(swapped_side_first_component) :] * right_swap = left_remainder.replace("-", "+") # <<<<<<<<<<<<<< * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" * if "/" in unique_operators: @@ -7343,7 +7077,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_7 = 0; /* "constraint/parser.py":126 - * left_remainder = left[len(swapped_side_first_component):] + * left_remainder = left[len(swapped_side_first_component) :] * right_swap = left_remainder.replace("-", "+") * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" # <<<<<<<<<<<<<< * if "/" in unique_operators: @@ -7371,7 +7105,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; } - __pyx_L29:; + __pyx_L13:; /* "constraint/parser.py":116 * else: @@ -7389,7 +7123,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if not variables_on_left: * # e.g. "G == B/M" becomes "G*M == B" */ - __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_mstate_global->__pyx_kp_u__12, __pyx_v_unique_operators, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySet_ContainsTF(__pyx_mstate_global->__pyx_kp_u__10, __pyx_v_unique_operators, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 127, __pyx_L1_error) if (__pyx_t_6) { /* "constraint/parser.py":128 @@ -7397,7 +7131,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if "/" in unique_operators: * if not variables_on_left: # <<<<<<<<<<<<<< * # e.g. "G == B/M" becomes "G*M == B" - * right_remainder = right[len(swapped_side_first_component):] + * right_remainder = right[len(swapped_side_first_component) :] */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 128, __pyx_L1_error) __pyx_t_1 = (!__pyx_t_6); @@ -7406,7 +7140,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ /* "constraint/parser.py":130 * if not variables_on_left: * # e.g. "G == B/M" becomes "G*M == B" - * right_remainder = right[len(swapped_side_first_component):] # <<<<<<<<<<<<<< + * right_remainder = right[len(swapped_side_first_component) :] # <<<<<<<<<<<<<< * left_swap = right_remainder.replace("/", "*") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" */ @@ -7418,7 +7152,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ /* "constraint/parser.py":131 * # e.g. "G == B/M" becomes "G*M == B" - * right_remainder = right[len(swapped_side_first_component):] + * right_remainder = right[len(swapped_side_first_component) :] * left_swap = right_remainder.replace("/", "*") # <<<<<<<<<<<<<< * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" * else: @@ -7432,7 +7166,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_8 = 0; /* "constraint/parser.py":132 - * right_remainder = right[len(swapped_side_first_component):] + * right_remainder = right[len(swapped_side_first_component) :] * left_swap = right_remainder.replace("/", "*") * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" # <<<<<<<<<<<<<< * else: @@ -7465,15 +7199,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if "/" in unique_operators: * if not variables_on_left: # <<<<<<<<<<<<<< * # e.g. "G == B/M" becomes "G*M == B" - * right_remainder = right[len(swapped_side_first_component):] + * right_remainder = right[len(swapped_side_first_component) :] */ - goto __pyx_L31; + goto __pyx_L15; } /* "constraint/parser.py":135 * else: * # e.g. "B/M == G" becomes "B == G*M" - * left_remainder = left[len(swapped_side_first_component):] # <<<<<<<<<<<<<< + * left_remainder = left[len(swapped_side_first_component) :] # <<<<<<<<<<<<<< * right_swap = left_remainder.replace("/", "*") * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" */ @@ -7486,7 +7220,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ /* "constraint/parser.py":136 * # e.g. "B/M == G" becomes "B == G*M" - * left_remainder = left[len(swapped_side_first_component):] + * left_remainder = left[len(swapped_side_first_component) :] * right_swap = left_remainder.replace("/", "*") # <<<<<<<<<<<<<< * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" * @@ -7500,7 +7234,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_11 = 0; /* "constraint/parser.py":137 - * left_remainder = left[len(swapped_side_first_component):] + * left_remainder = left[len(swapped_side_first_component) :] * right_swap = left_remainder.replace("/", "*") * restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" # <<<<<<<<<<<<<< * @@ -7528,7 +7262,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF_SET(__pyx_v_restriction, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; } - __pyx_L31:; + __pyx_L15:; /* "constraint/parser.py":127 * right_swap = left_remainder.replace("-", "+") @@ -7543,10 +7277,10 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * * # we have a potentially rewritten restriction, split again * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< - * operators_left = [s.strip() for s in list(left) if s in supported_operators] - * operators_right = [s.strip() for s in list(right) if s in supported_operators] + * operators_left = extract_operators(left) + * operators_right = extract_operators(right) */ - __pyx_t_8 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_8 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_6genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -7580,118 +7314,72 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ /* "constraint/parser.py":141 * # we have a potentially rewritten restriction, split again * left, right = tuple(s.strip() for s in restriction.split(comparator)) - * operators_left = [s.strip() for s in list(left) if s in supported_operators] # <<<<<<<<<<<<<< - * operators_right = [s.strip() for s in list(right) if s in supported_operators] + * operators_left = extract_operators(left) # <<<<<<<<<<<<<< + * operators_right = extract_operators(right) * unique_operators_left = set(operators_left) */ - { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PySequence_List(__pyx_v_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __pyx_t_5; __Pyx_INCREF(__pyx_t_8); - __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 141, __pyx_L34_error) - #endif - if (__pyx_t_3 >= __pyx_temp) break; - } - __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_3); - ++__pyx_t_3; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_s, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr7__pyx_v_s, __pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 141, __pyx_L34_error) - if (__pyx_t_1) { - __pyx_t_7 = __pyx_8genexpr7__pyx_v_s; - __Pyx_INCREF(__pyx_t_7); - __pyx_t_9 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_5); - } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 141, __pyx_L34_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - } + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_extract_operators); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __pyx_t_9 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_left}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); __pyx_8genexpr7__pyx_v_s = 0; - goto __pyx_L39_exit_scope; - __pyx_L34_error:; - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); __pyx_8genexpr7__pyx_v_s = 0; - goto __pyx_L1_error; - __pyx_L39_exit_scope:; - } /* exit inner scope */ - __Pyx_DECREF_SET(__pyx_v_operators_left, ((PyObject*)__pyx_t_2)); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_DECREF_SET(__pyx_v_operators_left, __pyx_t_2); __pyx_t_2 = 0; /* "constraint/parser.py":142 * left, right = tuple(s.strip() for s in restriction.split(comparator)) - * operators_left = [s.strip() for s in list(left) if s in supported_operators] - * operators_right = [s.strip() for s in list(right) if s in supported_operators] # <<<<<<<<<<<<<< + * operators_left = extract_operators(left) + * operators_right = extract_operators(right) # <<<<<<<<<<<<<< * unique_operators_left = set(operators_left) * unique_operators_right = set(operators_right) */ - { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PySequence_List(__pyx_v_right); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 142, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __pyx_t_8; __Pyx_INCREF(__pyx_t_5); - __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 142, __pyx_L42_error) - #endif - if (__pyx_t_3 >= __pyx_temp) break; - } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_3); - ++__pyx_t_3; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 142, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_s, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_8genexpr8__pyx_v_s, __pyx_v_supported_operators, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 142, __pyx_L42_error) - if (__pyx_t_1) { - __pyx_t_7 = __pyx_8genexpr8__pyx_v_s; - __Pyx_INCREF(__pyx_t_7); - __pyx_t_9 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 142, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_8); - } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 142, __pyx_L42_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - } + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_extract_operators); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __pyx_t_9 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_right}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_s); __pyx_8genexpr8__pyx_v_s = 0; - goto __pyx_L47_exit_scope; - __pyx_L42_error:; - __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_s); __pyx_8genexpr8__pyx_v_s = 0; - goto __pyx_L1_error; - __pyx_L47_exit_scope:; - } /* exit inner scope */ - __Pyx_DECREF_SET(__pyx_v_operators_right, ((PyObject*)__pyx_t_2)); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_DECREF_SET(__pyx_v_operators_right, __pyx_t_2); __pyx_t_2 = 0; /* "constraint/parser.py":143 - * operators_left = [s.strip() for s in list(left) if s in supported_operators] - * operators_right = [s.strip() for s in list(right) if s in supported_operators] + * operators_left = extract_operators(left) + * operators_right = extract_operators(right) * unique_operators_left = set(operators_left) # <<<<<<<<<<<<<< * unique_operators_right = set(operators_right) * unique_operators = unique_operators_left.union(unique_operators_right) @@ -7702,7 +7390,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_2 = 0; /* "constraint/parser.py":144 - * operators_right = [s.strip() for s in list(right) if s in supported_operators] + * operators_right = extract_operators(right) * unique_operators_left = set(operators_left) * unique_operators_right = set(operators_right) # <<<<<<<<<<<<<< * unique_operators = unique_operators_left.union(unique_operators_right) @@ -7725,903 +7413,1257 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF_SET(__pyx_v_unique_operators, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":108 + /* "constraint/parser.py":106 * unique_operators_right = set(operators_right) * unique_operators = unique_operators_left.union(unique_operators_right) * if len(unique_operators) == 1: # <<<<<<<<<<<<<< * variables_on_left = len(unique_operators_left) > 0 - * swapped_side_first_component = re.search(regex_match_variable_or_constant, left if variables_on_left else right) # noqa: E501 + * swapped_side_first_component = re.search( */ } - /* "constraint/parser.py":148 - * + /* "constraint/parser.py":149 * # find out which side is the constant number - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< - * try: - * # check if it's a number or solvable to a number (e.g. '32*2') -*/ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_s, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 148, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_Union_int_float) < 0) __PYX_ERR(0, 148, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_1is_or_evals_to_number, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_3, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_is_or_evals_to_number = __pyx_t_5; - __pyx_t_5 = 0; - - /* "constraint/parser.py":159 - * * # either the left or right side of the equation must evaluate to a constant number, otherwise we use a VariableConstraint # noqa: E501 * left_num = is_or_evals_to_number(left) # <<<<<<<<<<<<<< * right_num = is_or_evals_to_number(right) * if (left_num is None and right_num is None) or (left_num is not None and right_num is not None): */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_left))||((__pyx_v_left) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_left))) __PYX_ERR(0, 159, __pyx_L1_error) - __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_v_is_or_evals_to_number, ((PyObject*)__pyx_v_left)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_v_left_num = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_is_or_evals_to_number); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_5); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __pyx_t_9 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_left}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_v_left_num = __pyx_t_2; + __pyx_t_2 = 0; - /* "constraint/parser.py":160 + /* "constraint/parser.py":150 * # either the left or right side of the equation must evaluate to a constant number, otherwise we use a VariableConstraint # noqa: E501 * left_num = is_or_evals_to_number(left) * right_num = is_or_evals_to_number(right) # <<<<<<<<<<<<<< * if (left_num is None and right_num is None) or (left_num is not None and right_num is not None): * # if both sides are parameters, try to use the VariableConstraints */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_right))||((__pyx_v_right) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_right))) __PYX_ERR(0, 160, __pyx_L1_error) - __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_v_is_or_evals_to_number, ((PyObject*)__pyx_v_right)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_is_or_evals_to_number); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_v_right_num = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_9 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); + __pyx_t_9 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_right}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_v_right_num = __pyx_t_2; + __pyx_t_2 = 0; - /* "constraint/parser.py":161 + /* "constraint/parser.py":151 * left_num = is_or_evals_to_number(left) * right_num = is_or_evals_to_number(right) * if (left_num is None and right_num is None) or (left_num is not None and right_num is not None): # <<<<<<<<<<<<<< * # if both sides are parameters, try to use the VariableConstraints - * variable_supported_operators = ['+', '*'] + * variable_supported_operators = ["+", "*"] */ __pyx_t_6 = (__pyx_v_left_num == Py_None); if (!__pyx_t_6) { - goto __pyx_L50_next_or; + goto __pyx_L18_next_or; } else { } __pyx_t_6 = (__pyx_v_right_num == Py_None); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L49_bool_binop_done; + goto __pyx_L17_bool_binop_done; } - __pyx_L50_next_or:; + __pyx_L18_next_or:; __pyx_t_6 = (__pyx_v_left_num != Py_None); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L49_bool_binop_done; + goto __pyx_L17_bool_binop_done; } __pyx_t_6 = (__pyx_v_right_num != Py_None); __pyx_t_1 = __pyx_t_6; - __pyx_L49_bool_binop_done:; + __pyx_L17_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":163 + /* "constraint/parser.py":153 * if (left_num is None and right_num is None) or (left_num is not None and right_num is not None): * # if both sides are parameters, try to use the VariableConstraints - * variable_supported_operators = ['+', '*'] # <<<<<<<<<<<<<< + * variable_supported_operators = ["+", "*"] # <<<<<<<<<<<<<< * # variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] * variables = re.findall(regex_match_variable, restriction) */ - __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__10); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__10); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_kp_u__10) != (0)) __PYX_ERR(0, 163, __pyx_L1_error); + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__9); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__9); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u__9) != (0)) __PYX_ERR(0, 163, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_cur_scope->__pyx_v_variable_supported_operators = ((PyObject*)__pyx_t_5); - __pyx_t_5 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_kp_u__9) != (0)) __PYX_ERR(0, 153, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__11); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__11); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_kp_u__11) != (0)) __PYX_ERR(0, 153, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_v_variable_supported_operators = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/parser.py":165 - * variable_supported_operators = ['+', '*'] + /* "constraint/parser.py":155 + * variable_supported_operators = ["+", "*"] * # variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] * variables = re.findall(regex_match_variable, restriction) # <<<<<<<<<<<<<< * - * # find all unique variable_supported_operators in the restriction, can have at most one + * # if the restriction contains more than the variables and supported operators, return None */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_5 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable)) { __Pyx_RaiseClosureNameError("regex_match_variable"); __PYX_ERR(0, 165, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable)) { __Pyx_RaiseClosureNameError("regex_match_variable"); __PYX_ERR(0, 155, __pyx_L1_error) } __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); - assert(__pyx_t_2); + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); + assert(__pyx_t_5); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable, __pyx_v_restriction}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_regex_match_variable, __pyx_v_restriction}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_v_variables = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_variables = __pyx_t_2; + __pyx_t_2 = 0; - /* "constraint/parser.py":168 + /* "constraint/parser.py":158 * - * # find all unique variable_supported_operators in the restriction, can have at most one - * variable_operators_left = list(s.strip() for s in list(left) if s in variable_supported_operators) # <<<<<<<<<<<<<< - * variable_operators_right = list(s.strip() for s in list(right) if s in variable_supported_operators) - * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) + * # if the restriction contains more than the variables and supported operators, return None + * if len(variables) == 0: # <<<<<<<<<<<<<< + * return None + * if any(var.strip() not in tune_params for var in variables): */ - __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_variable_operators_left = ((PyObject*)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_t_3 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = (__pyx_t_3 == 0); + if (__pyx_t_1) { - /* "constraint/parser.py":169 - * # find all unique variable_supported_operators in the restriction, can have at most one - * variable_operators_left = list(s.strip() for s in list(left) if s in variable_supported_operators) - * variable_operators_right = list(s.strip() for s in list(right) if s in variable_supported_operators) # <<<<<<<<<<<<<< - * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) - * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + /* "constraint/parser.py":159 + * # if the restriction contains more than the variables and supported operators, return None + * if len(variables) == 0: + * return None # <<<<<<<<<<<<<< + * if any(var.strip() not in tune_params for var in variables): + * raise ValueError(f"Variables {variables} not in tune_params {tune_params.keys()}") */ - __pyx_t_7 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_right); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_variable_operators_right = ((PyObject*)__pyx_t_5); - __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; - /* "constraint/parser.py":170 - * variable_operators_left = list(s.strip() for s in list(left) if s in variable_supported_operators) - * variable_operators_right = list(s.strip() for s in list(right) if s in variable_supported_operators) - * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) # <<<<<<<<<<<<<< - * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - * if len(variable_unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0): # noqa: E501 + /* "constraint/parser.py":158 + * + * # if the restriction contains more than the variables and supported operators, return None + * if len(variables) == 0: # <<<<<<<<<<<<<< + * return None + * if any(var.strip() not in tune_params for var in variables): */ - __pyx_t_2 = PySet_New(__pyx_v_variable_operators_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __pyx_t_2; - __Pyx_INCREF(__pyx_t_7); - __pyx_t_8 = PySet_New(__pyx_v_variable_operators_right); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = 0; - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8}; - __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_union, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); } - __pyx_t_2 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_variable_unique_operators = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - /* "constraint/parser.py":172 - * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) - * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - * if len(variable_unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0): # noqa: E501 # <<<<<<<<<<<<<< - * variables_on_left = len(unique_operators_left) > 0 - * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": + /* "constraint/parser.py":160 + * if len(variables) == 0: + * return None + * if any(var.strip() not in tune_params for var in variables): # <<<<<<<<<<<<<< + * raise ValueError(f"Variables {variables} not in tune_params {tune_params.keys()}") + * if ( */ - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_variable_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 172, __pyx_L1_error) - __pyx_t_6 = (__pyx_t_3 <= 1); - if (__pyx_t_6) { - } else { - __pyx_t_1 = __pyx_t_6; - goto __pyx_L54_bool_binop_done; - } - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_9genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 172, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { - } else { - __pyx_t_1 = __pyx_t_6; - goto __pyx_L54_bool_binop_done; - } - __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_left); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 172, __pyx_L1_error) - __pyx_t_6 = (__pyx_t_3 == 0); - if (!__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(__pyx_t_1)) { + + /* "constraint/parser.py":161 + * return None + * if any(var.strip() not in tune_params for var in variables): + * raise ValueError(f"Variables {variables} not in tune_params {tune_params.keys()}") # <<<<<<<<<<<<<< + * if ( + * len(re.findall(r"[+-]?\d+", restriction)) > 0 +*/ + __pyx_t_2 = NULL; + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_variables, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 161, __pyx_L1_error) } + if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params == Py_None)) { + PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys"); + __PYX_ERR(0, 161, __pyx_L1_error) + } + __pyx_t_8 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Variables; + __pyx_t_10[1] = __pyx_t_5; + __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_not_in_tune_params; + __pyx_t_10[3] = __pyx_t_11; + __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 20 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11)); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_9 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8}; + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + } + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 161, __pyx_L1_error) + + /* "constraint/parser.py":160 + * if len(variables) == 0: + * return None + * if any(var.strip() not in tune_params for var in variables): # <<<<<<<<<<<<<< + * raise ValueError(f"Variables {variables} not in tune_params {tune_params.keys()}") + * if ( +*/ + } + + /* "constraint/parser.py":163 + * raise ValueError(f"Variables {variables} not in tune_params {tune_params.keys()}") + * if ( + * len(re.findall(r"[+-]?\d+", restriction)) > 0 # <<<<<<<<<<<<<< + * ): # TODO adjust when we support modifiers such as multipliers (see roadmap) # noqa: E501 + * # if the restriction contains numbers, return None +*/ + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __pyx_t_9 = 0; + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_d, __pyx_v_restriction}; + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + } + __pyx_t_3 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = (__pyx_t_3 > 0); + + /* "constraint/parser.py":162 + * if any(var.strip() not in tune_params for var in variables): + * raise ValueError(f"Variables {variables} not in tune_params {tune_params.keys()}") + * if ( # <<<<<<<<<<<<<< + * len(re.findall(r"[+-]?\d+", restriction)) > 0 + * ): # TODO adjust when we support modifiers such as multipliers (see roadmap) # noqa: E501 +*/ + if (__pyx_t_1) { + + /* "constraint/parser.py":166 + * ): # TODO adjust when we support modifiers such as multipliers (see roadmap) # noqa: E501 + * # if the restriction contains numbers, return None + * return None # <<<<<<<<<<<<<< + * + * # find all unique variable_supported_operators in the restriction, can have at most one +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + + /* "constraint/parser.py":162 + * if any(var.strip() not in tune_params for var in variables): + * raise ValueError(f"Variables {variables} not in tune_params {tune_params.keys()}") + * if ( # <<<<<<<<<<<<<< + * len(re.findall(r"[+-]?\d+", restriction)) > 0 + * ): # TODO adjust when we support modifiers such as multipliers (see roadmap) # noqa: E501 +*/ + } + + /* "constraint/parser.py":169 + * + * # find all unique variable_supported_operators in the restriction, can have at most one + * variable_operators_left = list(s.strip() for s in list(left) if s in variable_supported_operators) # <<<<<<<<<<<<<< + * variable_operators_right = list(s.strip() for s in list(right) if s in variable_supported_operators) + * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) +*/ + __pyx_t_7 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_12genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_left); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_variable_operators_left = ((PyObject*)__pyx_t_11); + __pyx_t_11 = 0; + + /* "constraint/parser.py":170 + * # find all unique variable_supported_operators in the restriction, can have at most one + * variable_operators_left = list(s.strip() for s in list(left) if s in variable_supported_operators) + * variable_operators_right = list(s.strip() for s in list(right) if s in variable_supported_operators) # <<<<<<<<<<<<<< + * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) + * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None +*/ + __pyx_t_11 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_15genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_right); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_v_variable_operators_right = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; + + /* "constraint/parser.py":171 + * variable_operators_left = list(s.strip() for s in list(left) if s in variable_supported_operators) + * variable_operators_right = list(s.strip() for s in list(right) if s in variable_supported_operators) + * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) # <<<<<<<<<<<<<< + * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + * if ( +*/ + __pyx_t_8 = PySet_New(__pyx_v_variable_operators_left); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = __pyx_t_8; + __Pyx_INCREF(__pyx_t_11); + __pyx_t_2 = PySet_New(__pyx_v_variable_operators_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_2}; + __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_union, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + } + __pyx_t_8 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_variable_unique_operators = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; + + /* "constraint/parser.py":174 + * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None + * if ( + * len(variable_unique_operators) <= 1 # <<<<<<<<<<<<<< + * and all(s.strip() in params for s in variables) + * and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0) +*/ + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_variable_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_6 = (__pyx_t_3 <= 1); + if (__pyx_t_6) { + } else { + __pyx_t_1 = __pyx_t_6; + goto __pyx_L25_bool_binop_done; + } + + /* "constraint/parser.py":175 + * if ( + * len(variable_unique_operators) <= 1 + * and all(s.strip() in params for s in variables) # <<<<<<<<<<<<<< + * and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0) + * ): # noqa: E501 +*/ + __pyx_t_8 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_18genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_variables); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_6) { + } else { + __pyx_t_1 = __pyx_t_6; + goto __pyx_L25_bool_binop_done; + } + + /* "constraint/parser.py":176 + * len(variable_unique_operators) <= 1 + * and all(s.strip() in params for s in variables) + * and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0) # <<<<<<<<<<<<<< + * ): # noqa: E501 + * variables_on_left = len(unique_operators_left) > 0 +*/ + __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_left); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_6 = (__pyx_t_3 == 0); + if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L54_bool_binop_done; + goto __pyx_L25_bool_binop_done; } - __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_right); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_right); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 176, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 == 0); __pyx_t_1 = __pyx_t_6; - __pyx_L54_bool_binop_done:; - if (__pyx_t_1) { + __pyx_L25_bool_binop_done:; - /* "constraint/parser.py":173 + /* "constraint/parser.py":173 + * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - * if len(variable_unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0): # noqa: E501 + * if ( # <<<<<<<<<<<<<< + * len(variable_unique_operators) <= 1 + * and all(s.strip() in params for s in variables) +*/ + if (__pyx_t_1) { + + /* "constraint/parser.py":178 + * and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0) + * ): # noqa: E501 * variables_on_left = len(unique_operators_left) > 0 # <<<<<<<<<<<<<< * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": * if comparator == "==": */ - __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_left); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 173, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PySet_GET_SIZE(__pyx_v_unique_operators_left); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyBool_FromLong((__pyx_t_3 > 0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/parser.py":174 - * if len(variable_unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0): # noqa: E501 + /* "constraint/parser.py":179 + * ): # noqa: E501 * variables_on_left = len(unique_operators_left) > 0 * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": # <<<<<<<<<<<<<< * if comparator == "==": - * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 + * return ( */ - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_variable_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_variable_unique_operators); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 179, __pyx_L1_error) __pyx_t_6 = (__pyx_t_3 == 0); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L59_bool_binop_done; + goto __pyx_L30_bool_binop_done; } - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_variable_unique_operators, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_mstate_global->__pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 174, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_variable_unique_operators, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_mstate_global->__pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_1 = __pyx_t_6; - __pyx_L59_bool_binop_done:; + __pyx_L30_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":175 + /* "constraint/parser.py":180 * variables_on_left = len(unique_operators_left) > 0 * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": * if comparator == "==": # <<<<<<<<<<<<<< - * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 - * elif comparator == "<=": + * return ( + * VariableExactSumConstraint(variables[-1], variables[:-1]) */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 175, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":176 + /* "constraint/parser.py":181 * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": * if comparator == "==": - * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 # <<<<<<<<<<<<<< - * elif comparator == "<=": - * # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) + * return ( # <<<<<<<<<<<<<< + * VariableExactSumConstraint(variables[-1], variables[:-1]) + * if variables_on_left */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) + + /* "constraint/parser.py":183 + * return ( + * VariableExactSumConstraint(variables[-1], variables[:-1]) + * if variables_on_left # <<<<<<<<<<<<<< + * else VariableExactSumConstraint(variables[0], variables[1:]) + * ) # noqa: E501 +*/ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 183, __pyx_L1_error) if (__pyx_t_1) { - __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 176, __pyx_L1_error) + + /* "constraint/parser.py":182 + * if comparator == "==": + * return ( + * VariableExactSumConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< + * if variables_on_left + * else VariableExactSumConstraint(variables[0], variables[1:]) +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - assert(__pyx_t_8); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_11, __pyx_t_12}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_12}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } else { - __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 176, __pyx_L1_error) + + /* "constraint/parser.py":184 + * VariableExactSumConstraint(variables[-1], variables[:-1]) + * if variables_on_left + * else VariableExactSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * ) # noqa: E501 + * elif comparator == "<=": +*/ + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12); - assert(__pyx_t_7); + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); + assert(__pyx_t_11); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_11, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_5, __pyx_t_2}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":175 + /* "constraint/parser.py":180 * variables_on_left = len(unique_operators_left) > 0 * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": * if comparator == "==": # <<<<<<<<<<<<<< - * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 - * elif comparator == "<=": + * return ( + * VariableExactSumConstraint(variables[-1], variables[:-1]) */ } - /* "constraint/parser.py":177 - * if comparator == "==": - * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":186 + * else VariableExactSumConstraint(variables[0], variables[1:]) + * ) # noqa: E501 * elif comparator == "<=": # <<<<<<<<<<<<<< * # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) - * return VariableMaxSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinSumConstraint(variables[0], variables[1:]) # noqa: E501 + * return ( */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":179 + /* "constraint/parser.py":188 * elif comparator == "<=": * # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) - * return VariableMaxSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinSumConstraint(variables[0], variables[1:]) # noqa: E501 # <<<<<<<<<<<<<< - * elif comparator == ">=": - * # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) + * return ( # <<<<<<<<<<<<<< + * VariableMaxSumConstraint(variables[-1], variables[:-1]) + * if variables_on_left */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 179, __pyx_L1_error) + + /* "constraint/parser.py":190 + * return ( + * VariableMaxSumConstraint(variables[-1], variables[:-1]) + * if variables_on_left # <<<<<<<<<<<<<< + * else VariableMinSumConstraint(variables[0], variables[1:]) + * ) # noqa: E501 +*/ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 190, __pyx_L1_error) if (__pyx_t_1) { + + /* "constraint/parser.py":189 + * # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) + * return ( + * VariableMaxSumConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< + * if variables_on_left + * else VariableMinSumConstraint(variables[0], variables[1:]) +*/ __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_11, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_5, __pyx_t_11}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } else { - __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 179, __pyx_L1_error) + + /* "constraint/parser.py":191 + * VariableMaxSumConstraint(variables[-1], variables[:-1]) + * if variables_on_left + * else VariableMinSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * ) # noqa: E501 + * elif comparator == ">=": +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - assert(__pyx_t_8); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_11, __pyx_t_12}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_12}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":177 - * if comparator == "==": - * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":186 + * else VariableExactSumConstraint(variables[0], variables[1:]) + * ) # noqa: E501 * elif comparator == "<=": # <<<<<<<<<<<<<< * # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) - * return VariableMaxSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinSumConstraint(variables[0], variables[1:]) # noqa: E501 + * return ( */ } - /* "constraint/parser.py":180 - * # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) - * return VariableMaxSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinSumConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":193 + * else VariableMinSumConstraint(variables[0], variables[1:]) + * ) # noqa: E501 * elif comparator == ">=": # <<<<<<<<<<<<<< * # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) - * return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 + * return ( */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 193, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":182 + /* "constraint/parser.py":195 * elif comparator == ">=": * # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) - * return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 # <<<<<<<<<<<<<< - * elif variable_unique_operators[0] == "*": - * if comparator == "==": + * return ( # <<<<<<<<<<<<<< + * VariableMinSumConstraint(variables[-1], variables[:-1]) + * if variables_on_left */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 182, __pyx_L1_error) + + /* "constraint/parser.py":197 + * return ( + * VariableMinSumConstraint(variables[-1], variables[:-1]) + * if variables_on_left # <<<<<<<<<<<<<< + * else VariableMaxSumConstraint(variables[0], variables[1:]) + * ) # noqa: E501 +*/ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 197, __pyx_L1_error) if (__pyx_t_1) { - __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 182, __pyx_L1_error) + + /* "constraint/parser.py":196 + * # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) + * return ( + * VariableMinSumConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< + * if variables_on_left + * else VariableMaxSumConstraint(variables[0], variables[1:]) +*/ + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12); - assert(__pyx_t_7); + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); + assert(__pyx_t_11); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_11, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_5, __pyx_t_2}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 196, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } else { + + /* "constraint/parser.py":198 + * VariableMinSumConstraint(variables[-1], variables[:-1]) + * if variables_on_left + * else VariableMaxSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * ) # noqa: E501 + * elif variable_unique_operators[0] == "*": +*/ __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_11, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_5, __pyx_t_11}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":180 - * # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) - * return VariableMaxSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinSumConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":193 + * else VariableMinSumConstraint(variables[0], variables[1:]) + * ) # noqa: E501 * elif comparator == ">=": # <<<<<<<<<<<<<< * # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) - * return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 + * return ( */ } - /* "constraint/parser.py":174 - * if len(variable_unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0): # noqa: E501 + /* "constraint/parser.py":179 + * ): # noqa: E501 * variables_on_left = len(unique_operators_left) > 0 * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": # <<<<<<<<<<<<<< * if comparator == "==": - * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 + * return ( */ - goto __pyx_L58; + goto __pyx_L29; } - /* "constraint/parser.py":183 - * # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) - * return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":200 + * else VariableMaxSumConstraint(variables[0], variables[1:]) + * ) # noqa: E501 * elif variable_unique_operators[0] == "*": # <<<<<<<<<<<<<< * if comparator == "==": - * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 + * return ( */ - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_variable_unique_operators, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_mstate_global->__pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 183, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_variable_unique_operators, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_mstate_global->__pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_1) { - /* "constraint/parser.py":184 - * return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":201 + * ) # noqa: E501 * elif variable_unique_operators[0] == "*": * if comparator == "==": # <<<<<<<<<<<<<< - * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 - * elif comparator == "<=": + * return ( + * VariableExactProdConstraint(variables[-1], variables[:-1]) */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 201, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":185 + /* "constraint/parser.py":202 * elif variable_unique_operators[0] == "*": * if comparator == "==": - * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 # <<<<<<<<<<<<<< - * elif comparator == "<=": - * # "B*C <= A" (maxprod) if variables_on_left else "A <= B*C" (minprod) + * return ( # <<<<<<<<<<<<<< + * VariableExactProdConstraint(variables[-1], variables[:-1]) + * if variables_on_left */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 185, __pyx_L1_error) + + /* "constraint/parser.py":204 + * return ( + * VariableExactProdConstraint(variables[-1], variables[:-1]) + * if variables_on_left # <<<<<<<<<<<<<< + * else VariableExactProdConstraint(variables[0], variables[1:]) + * ) # noqa: E501 +*/ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) if (__pyx_t_1) { - __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 185, __pyx_L1_error) + + /* "constraint/parser.py":203 + * if comparator == "==": + * return ( + * VariableExactProdConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< + * if variables_on_left + * else VariableExactProdConstraint(variables[0], variables[1:]) +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - assert(__pyx_t_8); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_11, __pyx_t_12}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_12}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } else { - __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 185, __pyx_L1_error) + + /* "constraint/parser.py":205 + * VariableExactProdConstraint(variables[-1], variables[:-1]) + * if variables_on_left + * else VariableExactProdConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * ) # noqa: E501 + * elif comparator == "<=": +*/ + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12); - assert(__pyx_t_7); + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); + assert(__pyx_t_11); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_11, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_5, __pyx_t_2}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":184 - * return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":201 + * ) # noqa: E501 * elif variable_unique_operators[0] == "*": * if comparator == "==": # <<<<<<<<<<<<<< - * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 - * elif comparator == "<=": + * return ( + * VariableExactProdConstraint(variables[-1], variables[:-1]) */ } - /* "constraint/parser.py":186 - * if comparator == "==": - * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":207 + * else VariableExactProdConstraint(variables[0], variables[1:]) + * ) # noqa: E501 * elif comparator == "<=": # <<<<<<<<<<<<<< * # "B*C <= A" (maxprod) if variables_on_left else "A <= B*C" (minprod) - * return VariableMaxProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinProdConstraint(variables[0], variables[1:]) # noqa: E501 + * return ( */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 207, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":188 + /* "constraint/parser.py":209 * elif comparator == "<=": * # "B*C <= A" (maxprod) if variables_on_left else "A <= B*C" (minprod) - * return VariableMaxProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinProdConstraint(variables[0], variables[1:]) # noqa: E501 # <<<<<<<<<<<<<< - * elif comparator == ">=": - * # "B*C >= A" (minprod) if variables_on_left else "A >= B*C" (maxprod) + * return ( # <<<<<<<<<<<<<< + * VariableMaxProdConstraint(variables[-1], variables[:-1]) + * if variables_on_left */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 188, __pyx_L1_error) + + /* "constraint/parser.py":211 + * return ( + * VariableMaxProdConstraint(variables[-1], variables[:-1]) + * if variables_on_left # <<<<<<<<<<<<<< + * else VariableMinProdConstraint(variables[0], variables[1:]) + * ) # noqa: E501 +*/ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 211, __pyx_L1_error) if (__pyx_t_1) { + + /* "constraint/parser.py":210 + * # "B*C <= A" (maxprod) if variables_on_left else "A <= B*C" (minprod) + * return ( + * VariableMaxProdConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< + * if variables_on_left + * else VariableMinProdConstraint(variables[0], variables[1:]) +*/ __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_11, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_5, __pyx_t_11}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } else { - __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 188, __pyx_L1_error) + + /* "constraint/parser.py":212 + * VariableMaxProdConstraint(variables[-1], variables[:-1]) + * if variables_on_left + * else VariableMinProdConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * ) # noqa: E501 + * elif comparator == ">=": +*/ + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - assert(__pyx_t_8); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_11, __pyx_t_12}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_12}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":186 - * if comparator == "==": - * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":207 + * else VariableExactProdConstraint(variables[0], variables[1:]) + * ) # noqa: E501 * elif comparator == "<=": # <<<<<<<<<<<<<< * # "B*C <= A" (maxprod) if variables_on_left else "A <= B*C" (minprod) - * return VariableMaxProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinProdConstraint(variables[0], variables[1:]) # noqa: E501 + * return ( */ } - /* "constraint/parser.py":189 - * # "B*C <= A" (maxprod) if variables_on_left else "A <= B*C" (minprod) - * return VariableMaxProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinProdConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":214 + * else VariableMinProdConstraint(variables[0], variables[1:]) + * ) # noqa: E501 * elif comparator == ">=": # <<<<<<<<<<<<<< * # "B*C >= A" (minprod) if variables_on_left else "A >= B*C" (maxprod) - * return VariableMinProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxProdConstraint(variables[0], variables[1:]) # noqa: E501 + * return ( */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 214, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":191 + /* "constraint/parser.py":216 * elif comparator == ">=": * # "B*C >= A" (minprod) if variables_on_left else "A >= B*C" (maxprod) - * return VariableMinProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxProdConstraint(variables[0], variables[1:]) # noqa: E501 # <<<<<<<<<<<<<< - * - * # left_num and right_num can't both be constants, or for other reasons we can't use a VariableConstraint + * return ( # <<<<<<<<<<<<<< + * VariableMinProdConstraint(variables[-1], variables[:-1]) + * if variables_on_left */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) + + /* "constraint/parser.py":218 + * return ( + * VariableMinProdConstraint(variables[-1], variables[:-1]) + * if variables_on_left # <<<<<<<<<<<<<< + * else VariableMaxProdConstraint(variables[0], variables[1:]) + * ) # noqa: E501 +*/ + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 218, __pyx_L1_error) if (__pyx_t_1) { - __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 191, __pyx_L1_error) + + /* "constraint/parser.py":217 + * # "B*C >= A" (minprod) if variables_on_left else "A >= B*C" (maxprod) + * return ( + * VariableMinProdConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< + * if variables_on_left + * else VariableMaxProdConstraint(variables[0], variables[1:]) +*/ + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_variables, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12); - assert(__pyx_t_7); + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12); + assert(__pyx_t_11); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_12, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_11, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_5, __pyx_t_2}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } else { - __pyx_t_12 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 191, __pyx_L1_error) + + /* "constraint/parser.py":219 + * VariableMinProdConstraint(variables[-1], variables[:-1]) + * if variables_on_left + * else VariableMaxProdConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * ) # noqa: E501 + * +*/ + __pyx_t_12 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_variables, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_12); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_11, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_5, __pyx_t_11}; + __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":189 - * # "B*C <= A" (maxprod) if variables_on_left else "A <= B*C" (minprod) - * return VariableMaxProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinProdConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":214 + * else VariableMinProdConstraint(variables[0], variables[1:]) + * ) # noqa: E501 * elif comparator == ">=": # <<<<<<<<<<<<<< * # "B*C >= A" (minprod) if variables_on_left else "A >= B*C" (maxprod) - * return VariableMinProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxProdConstraint(variables[0], variables[1:]) # noqa: E501 + * return ( */ } - /* "constraint/parser.py":183 - * # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) - * return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 + /* "constraint/parser.py":200 + * else VariableMaxSumConstraint(variables[0], variables[1:]) + * ) # noqa: E501 * elif variable_unique_operators[0] == "*": # <<<<<<<<<<<<<< * if comparator == "==": - * return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 + * return ( */ } - __pyx_L58:; + __pyx_L29:; - /* "constraint/parser.py":172 + /* "constraint/parser.py":173 * variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) * # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - * if len(variable_unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0): # noqa: E501 # <<<<<<<<<<<<<< - * variables_on_left = len(unique_operators_left) > 0 - * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": + * if ( # <<<<<<<<<<<<<< + * len(variable_unique_operators) <= 1 + * and all(s.strip() in params for s in variables) */ } - /* "constraint/parser.py":194 + /* "constraint/parser.py":223 * * # left_num and right_num can't both be constants, or for other reasons we can't use a VariableConstraint * return None # <<<<<<<<<<<<<< @@ -8632,16 +8674,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":161 + /* "constraint/parser.py":151 * left_num = is_or_evals_to_number(left) * right_num = is_or_evals_to_number(right) * if (left_num is None and right_num is None) or (left_num is not None and right_num is not None): # <<<<<<<<<<<<<< * # if both sides are parameters, try to use the VariableConstraints - * variable_supported_operators = ['+', '*'] + * variable_supported_operators = ["+", "*"] */ } - /* "constraint/parser.py":198 + /* "constraint/parser.py":227 * # if one side is a number, the other side must be a variable or expression * number, variables, variables_on_left = ( * (left_num, right.strip(), False) if left_num is not None else (right_num, left.strip(), True) # <<<<<<<<<<<<<< @@ -8650,97 +8692,97 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_t_1 = (__pyx_v_left_num != Py_None); if (__pyx_t_1) { - __pyx_t_8 = __pyx_v_right; - __Pyx_INCREF(__pyx_t_8); + __pyx_t_2 = __pyx_v_right; + __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; - __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; + __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_left_num); __Pyx_GIVEREF(__pyx_v_left_num); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 198, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 198, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 227, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 227, __pyx_L1_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_False) != (0)) __PYX_ERR(0, 198, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_5 = __pyx_t_8; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_False) != (0)) __PYX_ERR(0, 227, __pyx_L1_error); __pyx_t_8 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } else { - __pyx_t_2 = __pyx_v_left; - __Pyx_INCREF(__pyx_t_2); + __pyx_t_8 = __pyx_v_left; + __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; + __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_right_num); __Pyx_GIVEREF(__pyx_v_right_num); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_right_num) != (0)) __PYX_ERR(0, 198, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 198, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_right_num) != (0)) __PYX_ERR(0, 227, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 227, __pyx_L1_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_True) != (0)) __PYX_ERR(0, 198, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_5 = __pyx_t_2; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_True) != (0)) __PYX_ERR(0, 227, __pyx_L1_error); __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_8; + __pyx_t_8 = 0; } - if (likely(__pyx_t_5 != Py_None)) { - PyObject* sequence = __pyx_t_5; + if (likely(__pyx_t_7 != Py_None)) { + PyObject* sequence = __pyx_t_7; Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 197, __pyx_L1_error) + __PYX_ERR(0, 226, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __Pyx_INCREF(__pyx_t_2); - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_8); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); - __Pyx_INCREF(__pyx_t_7); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_11); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); #endif - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 226, __pyx_L1_error) } - /* "constraint/parser.py":197 + /* "constraint/parser.py":226 * * # if one side is a number, the other side must be a variable or expression * number, variables, variables_on_left = ( # <<<<<<<<<<<<<< * (left_num, right.strip(), False) if left_num is not None else (right_num, left.strip(), True) * ) */ - __pyx_v_number = __pyx_t_2; - __pyx_t_2 = 0; - __pyx_v_variables = __pyx_t_8; + __pyx_v_number = __pyx_t_8; __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_7); - __pyx_t_7 = 0; + __pyx_v_variables = __pyx_t_2; + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables_on_left, __pyx_t_11); + __pyx_t_11 = 0; - /* "constraint/parser.py":202 + /* "constraint/parser.py":231 * * # we can map '>' to '>=' and '<' to '<=' by adding a tiny offset to the number * offset = 1e-12 # <<<<<<<<<<<<<< @@ -8749,52 +8791,52 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ __pyx_v_offset = 1e-12; - /* "constraint/parser.py":203 + /* "constraint/parser.py":232 * # we can map '>' to '>=' and '<' to '<=' by adding a tiny offset to the number * offset = 1e-12 * if comparator == "<": # <<<<<<<<<<<<<< * if variables_on_left: * # (x < 2) == (x <= 2-offset) */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 232, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":204 + /* "constraint/parser.py":233 * offset = 1e-12 * if comparator == "<": * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-offset) * number -= offset */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":206 + /* "constraint/parser.py":235 * if variables_on_left: * # (x < 2) == (x <= 2-offset) * number -= offset # <<<<<<<<<<<<<< * else: * # (2 < x) == (2+offset <= x) */ - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_number, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_7); - __pyx_t_7 = 0; + __pyx_t_11 = PyNumber_InPlaceSubtract(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_11); + __pyx_t_11 = 0; - /* "constraint/parser.py":204 + /* "constraint/parser.py":233 * offset = 1e-12 * if comparator == "<": * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-offset) * number -= offset */ - goto __pyx_L64; + goto __pyx_L35; } - /* "constraint/parser.py":209 + /* "constraint/parser.py":238 * else: * # (2 < x) == (2+offset <= x) * number += offset # <<<<<<<<<<<<<< @@ -8802,72 +8844,72 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left: */ /*else*/ { - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_number, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_7); + __pyx_t_7 = 0; } - __pyx_L64:; + __pyx_L35:; - /* "constraint/parser.py":203 + /* "constraint/parser.py":232 * # we can map '>' to '>=' and '<' to '<=' by adding a tiny offset to the number * offset = 1e-12 * if comparator == "<": # <<<<<<<<<<<<<< * if variables_on_left: * # (x < 2) == (x <= 2-offset) */ - goto __pyx_L63; + goto __pyx_L34; } - /* "constraint/parser.py":210 + /* "constraint/parser.py":239 * # (2 < x) == (2+offset <= x) * number += offset * elif comparator == ">": # <<<<<<<<<<<<<< * if variables_on_left: * # (x > 2) == (x >= 2+offset) */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 239, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":211 + /* "constraint/parser.py":240 * number += offset * elif comparator == ">": * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+offset) * number += offset */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 240, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":213 + /* "constraint/parser.py":242 * if variables_on_left: * # (x > 2) == (x >= 2+offset) * number += offset # <<<<<<<<<<<<<< * else: * # (2 > x) == (2-offset >= x) */ - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_number, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_7); - __pyx_t_7 = 0; + __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_11); + __pyx_t_11 = 0; - /* "constraint/parser.py":211 + /* "constraint/parser.py":240 * number += offset * elif comparator == ">": * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+offset) * number += offset */ - goto __pyx_L65; + goto __pyx_L36; } - /* "constraint/parser.py":216 + /* "constraint/parser.py":245 * else: * # (2 > x) == (2-offset >= x) * number -= offset # <<<<<<<<<<<<<< @@ -8875,17 +8917,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # check if an operator is applied on the variables, if not return */ /*else*/ { - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_t_11 = PyFloat_FromDouble(__pyx_v_offset); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = PyNumber_InPlaceSubtract(__pyx_v_number, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_v_number, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_7); + __pyx_t_7 = 0; } - __pyx_L65:; + __pyx_L36:; - /* "constraint/parser.py":210 + /* "constraint/parser.py":239 * # (2 < x) == (2+offset <= x) * number += offset * elif comparator == ">": # <<<<<<<<<<<<<< @@ -8893,102 +8935,102 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # (x > 2) == (x >= 2+offset) */ } - __pyx_L63:; + __pyx_L34:; - /* "constraint/parser.py":219 + /* "constraint/parser.py":248 * * # check if an operator is applied on the variables, if not return * operators = [r"\*\*", r"\*", r"\+"] # <<<<<<<<<<<<<< * operators_found = re.findall(str("|".join(operators)), variables) * if len(operators_found) == 0: */ - __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__12); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__12); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_mstate_global->__pyx_kp_u__12) != (0)) __PYX_ERR(0, 248, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__13); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__13); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_mstate_global->__pyx_kp_u__13) != (0)) __PYX_ERR(0, 219, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_mstate_global->__pyx_kp_u__13) != (0)) __PYX_ERR(0, 248, __pyx_L1_error); __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__14); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__14); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_mstate_global->__pyx_kp_u__14) != (0)) __PYX_ERR(0, 219, __pyx_L1_error); - __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__15); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__15); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_mstate_global->__pyx_kp_u__15) != (0)) __PYX_ERR(0, 219, __pyx_L1_error); - __pyx_v_operators = ((PyObject*)__pyx_t_5); - __pyx_t_5 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_mstate_global->__pyx_kp_u__14) != (0)) __PYX_ERR(0, 248, __pyx_L1_error); + __pyx_v_operators = ((PyObject*)__pyx_t_7); + __pyx_t_7 = 0; - /* "constraint/parser.py":220 + /* "constraint/parser.py":249 * # check if an operator is applied on the variables, if not return * operators = [r"\*\*", r"\*", r"\+"] * operators_found = re.findall(str("|".join(operators)), variables) # <<<<<<<<<<<<<< * if len(operators_found) == 0: * # no operators found, return only based on comparator */ - __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_7); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_v_variables}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_2, __pyx_v_variables}; + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __pyx_v_operators_found = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_operators_found = __pyx_t_7; + __pyx_t_7 = 0; - /* "constraint/parser.py":221 + /* "constraint/parser.py":250 * operators = [r"\*\*", r"\*", r"\+"] * operators_found = re.findall(str("|".join(operators)), variables) * if len(operators_found) == 0: # <<<<<<<<<<<<<< * # no operators found, return only based on comparator * if len(params) != 1 or variables not in params: */ - __pyx_t_3 = PyObject_Length(__pyx_v_operators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_operators_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 250, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 == 0); if (__pyx_t_1) { - /* "constraint/parser.py":223 + /* "constraint/parser.py":252 * if len(operators_found) == 0: * # no operators found, return only based on comparator * if len(params) != 1 or variables not in params: # <<<<<<<<<<<<<< * # there were more than one variable but no operator * return None */ - __pyx_t_5 = __pyx_cur_scope->__pyx_v_params; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 223, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = __pyx_cur_scope->__pyx_v_params; + __Pyx_INCREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_7); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = (__pyx_t_3 != 1); if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L68_bool_binop_done; + goto __pyx_L39_bool_binop_done; } - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_variables, __pyx_cur_scope->__pyx_v_params, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_variables, __pyx_cur_scope->__pyx_v_params, Py_NE)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) __pyx_t_1 = __pyx_t_6; - __pyx_L68_bool_binop_done:; + __pyx_L39_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":225 + /* "constraint/parser.py":254 * if len(params) != 1 or variables not in params: * # there were more than one variable but no operator * return None # <<<<<<<<<<<<<< @@ -8999,7 +9041,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":223 + /* "constraint/parser.py":252 * if len(operators_found) == 0: * # no operators found, return only based on comparator * if len(params) != 1 or variables not in params: # <<<<<<<<<<<<<< @@ -9008,17 +9050,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":228 + /* "constraint/parser.py":257 * # map to a Constraint * # if there are restrictions with a single variable, it will be used to prune the domain at the start * elif comparator == "==": # <<<<<<<<<<<<<< * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 257, __pyx_L1_error) if (__pyx_t_1) { - /* "constraint/parser.py":229 + /* "constraint/parser.py":258 * # if there are restrictions with a single variable, it will be used to prune the domain at the start * elif comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< @@ -9026,34 +9068,34 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_number}; + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":228 + /* "constraint/parser.py":257 * # map to a Constraint * # if there are restrictions with a single variable, it will be used to prune the domain at the start * elif comparator == "==": # <<<<<<<<<<<<<< @@ -9062,25 +9104,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":230 + /* "constraint/parser.py":259 * elif comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": */ - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 259, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L70_bool_binop_done; + goto __pyx_L41_bool_binop_done; } - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 259, __pyx_L1_error) __pyx_t_1 = __pyx_t_6; - __pyx_L70_bool_binop_done:; + __pyx_L41_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":231 + /* "constraint/parser.py":260 * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -9088,65 +9130,65 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 260, __pyx_L1_error) if (__pyx_t_1) { - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_number}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } else { - __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_7); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_number}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":230 + /* "constraint/parser.py":259 * elif comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< @@ -9155,25 +9197,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":232 + /* "constraint/parser.py":261 * elif comparator == "<=" or comparator == "<": * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * raise ValueError(f"Invalid comparator {comparator}") */ - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 261, __pyx_L1_error) if (!__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; - goto __pyx_L72_bool_binop_done; + goto __pyx_L43_bool_binop_done; } - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 261, __pyx_L1_error) __pyx_t_1 = __pyx_t_6; - __pyx_L72_bool_binop_done:; + __pyx_L43_bool_binop_done:; if (__pyx_t_1) { - /* "constraint/parser.py":233 + /* "constraint/parser.py":262 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< @@ -9181,65 +9223,65 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 262, __pyx_L1_error) if (__pyx_t_1) { - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_number}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } else { - __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_7); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_number}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":232 + /* "constraint/parser.py":261 * elif comparator == "<=" or comparator == "<": * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< @@ -9248,36 +9290,33 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":234 + /* "constraint/parser.py":263 * elif comparator == ">=" or comparator == ">": * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * raise ValueError(f"Invalid comparator {comparator}") # <<<<<<<<<<<<<< * * # check which operator is applied on the variables */ - __pyx_t_8 = NULL; - __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_2 = __pyx_builtin_ValueError; - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_comparator, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = NULL; + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_comparator, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_11}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_11}; + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 263, __pyx_L1_error) - /* "constraint/parser.py":221 + /* "constraint/parser.py":250 * operators = [r"\*\*", r"\*", r"\+"] * operators_found = re.findall(str("|".join(operators)), variables) * if len(operators_found) == 0: # <<<<<<<<<<<<<< @@ -9286,37 +9325,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":237 + /* "constraint/parser.py":266 * * # check which operator is applied on the variables * operator = operators_found[0] # <<<<<<<<<<<<<< * if not all(o == operator for o in operators_found): * # if there is a mix of operators (e.g. 'x + y * z == 3'), return None */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_cur_scope->__pyx_v_operator = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_cur_scope->__pyx_v_operator = __pyx_t_7; + __pyx_t_7 = 0; - /* "constraint/parser.py":238 + /* "constraint/parser.py":267 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< * # if there is a mix of operators (e.g. 'x + y * z == 3'), return None * return None */ - __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 238, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_21genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_6 = (!__pyx_t_1); if (__pyx_t_6) { - /* "constraint/parser.py":240 + /* "constraint/parser.py":269 * if not all(o == operator for o in operators_found): * # if there is a mix of operators (e.g. 'x + y * z == 3'), return None * return None # <<<<<<<<<<<<<< @@ -9327,7 +9366,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":238 + /* "constraint/parser.py":267 * # check which operator is applied on the variables * operator = operators_found[0] * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< @@ -9336,66 +9375,66 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":243 + /* "constraint/parser.py":272 * * # split the string on the comparison * splitted = variables.split(operator) # <<<<<<<<<<<<<< * # check if there are only pure, non-recurring variables (no operations or constants) in the restriction * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): */ - __pyx_t_5 = __pyx_v_variables; - __Pyx_INCREF(__pyx_t_5); + __pyx_t_7 = __pyx_v_variables; + __Pyx_INCREF(__pyx_t_7); __pyx_t_9 = 0; { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_operator}; - __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_operator}; + __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_v_splitted = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_splitted = __pyx_t_11; + __pyx_t_11 = 0; - /* "constraint/parser.py":245 + /* "constraint/parser.py":274 * splitted = variables.split(operator) * # check if there are only pure, non-recurring variables (no operations or constants) in the restriction * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< * # map to a Constraint * if operator == "**": */ - __pyx_t_3 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 245, __pyx_L1_error) - __pyx_t_2 = __pyx_cur_scope->__pyx_v_params; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_11 = __pyx_cur_scope->__pyx_v_params; + __Pyx_INCREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_t_11); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_1 = (__pyx_t_3 == __pyx_t_13); if (__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L76_bool_binop_done; + goto __pyx_L47_bool_binop_done; } - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_11 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_24genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_Generator_GetInlinedResult(__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = __pyx_t_1; - __pyx_L76_bool_binop_done:; + __pyx_L47_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":247 + /* "constraint/parser.py":276 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if operator == "**": # <<<<<<<<<<<<<< * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None */ - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__8, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 276, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":249 + /* "constraint/parser.py":278 * if operator == "**": * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None # <<<<<<<<<<<<<< @@ -9406,7 +9445,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":247 + /* "constraint/parser.py":276 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if operator == "**": # <<<<<<<<<<<<<< @@ -9415,27 +9454,27 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":250 + /* "constraint/parser.py":279 * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None * elif operator == "*": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactProdConstraint(number) */ - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 279, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":251 + /* "constraint/parser.py":280 * return None * elif operator == "*": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactProdConstraint(number) * elif comparator == "<=" or comparator == "<": */ - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 280, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":252 + /* "constraint/parser.py":281 * elif operator == "*": * if comparator == "==": * return ExactProdConstraint(number) # <<<<<<<<<<<<<< @@ -9443,34 +9482,34 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); - assert(__pyx_t_2); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":251 + /* "constraint/parser.py":280 * return None * elif operator == "*": * if comparator == "==": # <<<<<<<<<<<<<< @@ -9479,25 +9518,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":253 + /* "constraint/parser.py":282 * if comparator == "==": * return ExactProdConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or comparator == ">": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 282, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L80_bool_binop_done; + goto __pyx_L51_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 282, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; - __pyx_L80_bool_binop_done:; + __pyx_L51_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":254 + /* "constraint/parser.py":283 * return ExactProdConstraint(number) * elif comparator == "<=" or comparator == "<": * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) # <<<<<<<<<<<<<< @@ -9505,65 +9544,65 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 283, __pyx_L1_error) if (__pyx_t_6) { - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_2); + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_11); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } else { __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); assert(__pyx_t_8); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_number}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":253 + /* "constraint/parser.py":282 * if comparator == "==": * return ExactProdConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< @@ -9572,25 +9611,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":255 + /* "constraint/parser.py":284 * elif comparator == "<=" or comparator == "<": * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 284, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L82_bool_binop_done; + goto __pyx_L53_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 284, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; - __pyx_L82_bool_binop_done:; + __pyx_L53_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":256 + /* "constraint/parser.py":285 * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or comparator == ">": * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) # <<<<<<<<<<<<<< @@ -9598,65 +9637,65 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if comparator == "==": */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 285, __pyx_L1_error) if (__pyx_t_6) { - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_11 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_2); + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_11); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } else { __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); assert(__pyx_t_8); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_number}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_5 = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_t_7 = __pyx_t_2; + __pyx_t_2 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":255 + /* "constraint/parser.py":284 * elif comparator == "<=" or comparator == "<": * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< @@ -9665,37 +9704,37 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":250 + /* "constraint/parser.py":279 * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None * elif operator == "*": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactProdConstraint(number) */ - goto __pyx_L78; + goto __pyx_L49; } - /* "constraint/parser.py":257 + /* "constraint/parser.py":286 * elif comparator == ">=" or comparator == ">": * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactSumConstraint(number) */ - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__10, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__9, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) if (likely(__pyx_t_6)) { - /* "constraint/parser.py":258 + /* "constraint/parser.py":287 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": */ - __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 287, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/parser.py":259 + /* "constraint/parser.py":288 * elif operator == "+": * if comparator == "==": * return ExactSumConstraint(number) # <<<<<<<<<<<<<< @@ -9703,34 +9742,34 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * # raise ValueError(restriction, comparator) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_11); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":258 + /* "constraint/parser.py":287 * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": * if comparator == "==": # <<<<<<<<<<<<<< @@ -9739,25 +9778,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":260 + /* "constraint/parser.py":289 * if comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L85_bool_binop_done; + goto __pyx_L56_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; - __pyx_L85_bool_binop_done:; + __pyx_L56_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":262 + /* "constraint/parser.py":291 * elif comparator == "<=" or comparator == "<": * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< @@ -9765,65 +9804,65 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 291, __pyx_L1_error) if (__pyx_t_6) { - __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_11); + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; + __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_11; + __pyx_t_11 = 0; } else { __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_8); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_number}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_11; + __pyx_t_11 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":260 + /* "constraint/parser.py":289 * if comparator == "==": * return ExactSumConstraint(number) * elif comparator == "<=" or comparator == "<": # <<<<<<<<<<<<<< @@ -9832,25 +9871,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":263 + /* "constraint/parser.py":292 * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: */ - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 292, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_6 = __pyx_t_1; - goto __pyx_L87_bool_binop_done; + goto __pyx_L58_bool_binop_done; } - __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 292, __pyx_L1_error) __pyx_t_6 = __pyx_t_1; - __pyx_L87_bool_binop_done:; + __pyx_L58_bool_binop_done:; if (__pyx_t_6) { - /* "constraint/parser.py":264 + /* "constraint/parser.py":293 * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< @@ -9858,65 +9897,65 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * raise ValueError(f"Invalid operator {operator}") */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 293, __pyx_L1_error) if (__pyx_t_6) { - __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_11); + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_9 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_number}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_number}; + __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_11; + __pyx_t_11 = 0; } else { __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); assert(__pyx_t_8); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_number}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); } - __pyx_t_5 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __pyx_t_11; + __pyx_t_11 = 0; } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "constraint/parser.py":263 + /* "constraint/parser.py":292 * # raise ValueError(restriction, comparator) * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or comparator == ">": # <<<<<<<<<<<<<< @@ -9925,17 +9964,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":257 + /* "constraint/parser.py":286 * elif comparator == ">=" or comparator == ">": * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactSumConstraint(number) */ - goto __pyx_L78; + goto __pyx_L49; } - /* "constraint/parser.py":266 + /* "constraint/parser.py":295 * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: * raise ValueError(f"Invalid operator {operator}") # <<<<<<<<<<<<<< @@ -9943,31 +9982,28 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * */ /*else*/ { - __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_11 = __pyx_builtin_ValueError; - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_11 = NULL; + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_operator, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_operator, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_8}; + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } - __Pyx_Raise(__pyx_t_5, 0, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(0, 295, __pyx_L1_error) } - __pyx_L78:; + __pyx_L49:; - /* "constraint/parser.py":245 + /* "constraint/parser.py":274 * splitted = variables.split(operator) * # check if there are only pure, non-recurring variables (no operations or constants) in the restriction * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< @@ -9976,7 +10012,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ */ } - /* "constraint/parser.py":267 + /* "constraint/parser.py":296 * else: * raise ValueError(f"Invalid operator {operator}") * return None # <<<<<<<<<<<<<< @@ -9987,12 +10023,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":79 + /* "constraint/parser.py":81 * return split_restrictions * - * def to_numeric_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]: # noqa: E501 + * def to_numeric_constraint(restriction: str, params: list[str]) -> MinSumConstraint | VariableMinSumConstraint | ExactSumConstraint | VariableExactSumConstraint | MaxSumConstraint | VariableMaxSumConstraint | MinProdConstraint | VariableMinProdConstraint | ExactProdConstraint | VariableExactProdConstraint | MaxProdConstraint | VariableMaxProdConstraint | None: # noqa: E501 # <<<<<<<<<<<<<< + * """Converts a restriction to a built-in numeric constraint if possible.""" + * # first check if all parameters have only numbers as values */ /* function exit code */ @@ -10011,7 +10047,6 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_XDECREF(__pyx_v_comparator); __Pyx_XDECREF(__pyx_v_left); __Pyx_XDECREF(__pyx_v_right); - __Pyx_XDECREF(__pyx_v_supported_operators); __Pyx_XDECREF(__pyx_v_operators_left); __Pyx_XDECREF(__pyx_v_operators_right); __Pyx_XDECREF(__pyx_v_unique_operators_left); @@ -10023,7 +10058,6 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_XDECREF(__pyx_v_left_swap); __Pyx_XDECREF(__pyx_v_left_remainder); __Pyx_XDECREF(__pyx_v_right_swap); - __Pyx_XDECREF(__pyx_v_is_or_evals_to_number); __Pyx_XDECREF(__pyx_v_left_num); __Pyx_XDECREF(__pyx_v_right_num); __Pyx_XDECREF(__pyx_v_variables); @@ -10034,18 +10068,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_XDECREF(__pyx_v_operators); __Pyx_XDECREF(__pyx_v_operators_found); __Pyx_XDECREF(__pyx_v_splitted); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_4generator); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator2); - __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_s); - __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_s); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator3); - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); - __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_s); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_13generator4); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_16generator5); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_19generator6); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_22generator7); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_25generator8); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2generator); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5generator2); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8generator3); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_11generator4); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_14generator5); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_17generator6); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_20generator7); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_23generator8); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_26generator9); __Pyx_XDECREF(__pyx_v_restriction); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -10053,12 +10084,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ return __pyx_r; } -/* "constraint/parser.py":269 +/* "constraint/parser.py":298 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: + * ) -> AllEqualConstraint | AllDifferentConstraint | None: */ /* Python wrapper */ @@ -10102,39 +10133,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_restriction,&__pyx_mstate_global->__pyx_n_u_params,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 269, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 298, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 269, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 298, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 269, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 298, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "to_equality_constraint", 0) < 0) __PYX_ERR(0, 269, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "to_equality_constraint", 0) < (0)) __PYX_ERR(0, 298, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, i); __PYX_ERR(0, 269, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, i); __PYX_ERR(0, 298, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 269, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 298, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 269, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 298, __pyx_L3_error) } __pyx_v_restriction = ((PyObject*)values[0]); __pyx_v_params = ((PyObject*)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 269, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_equality_constraint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 298, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10145,8 +10176,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 270, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 270, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 299, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 299, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality_constraint(__pyx_self, __pyx_v_restriction, __pyx_v_params); /* function exit code */ @@ -10165,9 +10196,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":288 +/* "constraint/parser.py":317 * splitted = restriction.split(comparator) * # check if there are only pure, non-recurring variables (no operations or constants) in the restriction * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< @@ -10176,29 +10207,29 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equality_constraint_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_13_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 288, __pyx_L1_error) + __PYX_ERR(0, 317, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator9, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_equ, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator10, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_equ, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10214,9 +10245,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equalit return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -10237,21 +10268,21 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 288, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 288, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 317, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 317, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 288, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 317, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_3); @@ -10262,13 +10293,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 288, __pyx_L1_error) } - __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 288, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 317, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { @@ -10309,21 +10340,21 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit return __pyx_r; } -/* "constraint/parser.py":269 +/* "constraint/parser.py":298 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: + * ) -> AllEqualConstraint | AllDifferentConstraint | None: */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality_constraint(PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *__pyx_cur_scope; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *__pyx_cur_scope; PyObject *__pyx_v_equalities_found = NULL; PyObject *__pyx_v_inequalities_found = NULL; PyObject *__pyx_v_comparator = NULL; PyObject *__pyx_v_splitted = NULL; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator9 = 0; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator10 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -10335,16 +10366,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality PyObject *__pyx_t_7 = NULL; size_t __pyx_t_8; int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_equality_constraint", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 269, __pyx_L1_error) + __PYX_ERR(0, 298, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10355,7 +10385,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __Pyx_INCREF(__pyx_cur_scope->__pyx_v_params); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_params); - /* "constraint/parser.py":274 + /* "constraint/parser.py":303 * """Converts a restriction to either an equality or inequality constraint on all the parameters if possible.""" * # check if all parameters are involved * if len(params) != len(tune_params): # <<<<<<<<<<<<<< @@ -10364,21 +10394,21 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ __pyx_t_1 = __pyx_cur_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 274, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 303, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_tune_params; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 274, __pyx_L1_error) + __PYX_ERR(0, 303, __pyx_L1_error) } - __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_3 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_2 != __pyx_t_3); if (__pyx_t_4) { - /* "constraint/parser.py":275 + /* "constraint/parser.py":304 * # check if all parameters are involved * if len(params) != len(tune_params): * return None # <<<<<<<<<<<<<< @@ -10389,7 +10419,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":274 + /* "constraint/parser.py":303 * """Converts a restriction to either an equality or inequality constraint on all the parameters if possible.""" * # check if all parameters are involved * if len(params) != len(tune_params): # <<<<<<<<<<<<<< @@ -10398,7 +10428,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":278 + /* "constraint/parser.py":307 * * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) # <<<<<<<<<<<<<< @@ -10406,9 +10436,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * # check if one of the two have been found, if none or both have been found, return None */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = 1; @@ -10425,16 +10455,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u__7, __pyx_v_restriction}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_equalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":279 + /* "constraint/parser.py":308 * # find whether (in)equalities appear in this restriction * equalities_found = re.findall("==", restriction) * inequalities_found = re.findall("!=", restriction) # <<<<<<<<<<<<<< @@ -10442,9 +10472,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * if not (bool(len(equalities_found) > 0) ^ bool(len(inequalities_found) > 0)): */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = 1; @@ -10461,40 +10491,40 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality #endif { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u__16, __pyx_v_restriction}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_inequalities_found = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":281 + /* "constraint/parser.py":310 * inequalities_found = re.findall("!=", restriction) * # check if one of the two have been found, if none or both have been found, return None * if not (bool(len(equalities_found) > 0) ^ bool(len(inequalities_found) > 0)): # <<<<<<<<<<<<<< * return None * comparator = equalities_found[0] if len(equalities_found) > 0 else inequalities_found[0] */ - __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 310, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 > 0); - __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_Length(__pyx_v_inequalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_inequalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 310, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 > 0); - __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_4))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_Xor(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_7 = PyNumber_Xor(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = (!__pyx_t_4); if (__pyx_t_9) { - /* "constraint/parser.py":282 + /* "constraint/parser.py":311 * # check if one of the two have been found, if none or both have been found, return None * if not (bool(len(equalities_found) > 0) ^ bool(len(inequalities_found) > 0)): * return None # <<<<<<<<<<<<<< @@ -10505,7 +10535,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":281 + /* "constraint/parser.py":310 * inequalities_found = re.findall("!=", restriction) * # check if one of the two have been found, if none or both have been found, return None * if not (bool(len(equalities_found) > 0) ^ bool(len(inequalities_found) > 0)): # <<<<<<<<<<<<<< @@ -10514,22 +10544,22 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":283 + /* "constraint/parser.py":312 * if not (bool(len(equalities_found) > 0) ^ bool(len(inequalities_found) > 0)): * return None * comparator = equalities_found[0] if len(equalities_found) > 0 else inequalities_found[0] # <<<<<<<<<<<<<< * * # split the string on the comparison */ - __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 312, __pyx_L1_error) __pyx_t_9 = (__pyx_t_3 > 0); if (__pyx_t_9) { - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_equalities_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_equalities_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_t_6; __pyx_t_6 = 0; } else { - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_inequalities_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_inequalities_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_t_6; __pyx_t_6 = 0; @@ -10537,29 +10567,29 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __pyx_v_comparator = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/parser.py":286 + /* "constraint/parser.py":315 * * # split the string on the comparison * splitted = restriction.split(comparator) # <<<<<<<<<<<<<< * # check if there are only pure, non-recurring variables (no operations or constants) in the restriction * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): */ - __pyx_t_7 = PyUnicode_Split(__pyx_v_restriction, __Pyx_NoneAsNull(__pyx_v_comparator), -1L); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_7 = PyUnicode_Split(__pyx_v_restriction, __Pyx_NoneAsNull(__pyx_v_comparator), -1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_splitted = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":288 + /* "constraint/parser.py":317 * splitted = restriction.split(comparator) * # check if there are only pure, non-recurring variables (no operations or constants) in the restriction * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< * # map to a Constraint * if comparator == "==": */ - __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_splitted); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_v_splitted); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 317, __pyx_L1_error) __pyx_t_7 = __pyx_cur_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_7); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_7); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = (__pyx_t_3 == __pyx_t_2); if (__pyx_t_4) { @@ -10567,28 +10597,28 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __pyx_t_9 = __pyx_t_4; goto __pyx_L6_bool_binop_done; } - __pyx_t_7 = __pyx_pf_10constraint_6parser_18parse_restrictions_22to_equality_constraint_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_7 = __pyx_pf_10constraint_6parser_18parse_restrictions_22to_equality_constraint_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_6 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (__pyx_t_9) { - /* "constraint/parser.py":290 + /* "constraint/parser.py":319 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if comparator == "==": # <<<<<<<<<<<<<< * return AllEqualConstraint() * elif comparator == "!=": */ - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 319, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":291 + /* "constraint/parser.py":320 * # map to a Constraint * if comparator == "==": * return AllEqualConstraint() # <<<<<<<<<<<<<< @@ -10597,7 +10627,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -10613,17 +10643,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":290 + /* "constraint/parser.py":319 * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): * # map to a Constraint * if comparator == "==": # <<<<<<<<<<<<<< @@ -10632,17 +10662,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":292 + /* "constraint/parser.py":321 * if comparator == "==": * return AllEqualConstraint() * elif comparator == "!=": # <<<<<<<<<<<<<< * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") */ - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 321, __pyx_L1_error) if (__pyx_t_9) { - /* "constraint/parser.py":293 + /* "constraint/parser.py":322 * return AllEqualConstraint() * elif comparator == "!=": * return AllDifferentConstraint() # <<<<<<<<<<<<<< @@ -10651,7 +10681,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 1; #if CYTHON_UNPACK_METHODS @@ -10667,17 +10697,17 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 293, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":292 + /* "constraint/parser.py":321 * if comparator == "==": * return AllEqualConstraint() * elif comparator == "!=": # <<<<<<<<<<<<<< @@ -10686,7 +10716,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":294 + /* "constraint/parser.py":323 * elif comparator == "!=": * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") # <<<<<<<<<<<<<< @@ -10695,28 +10725,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = NULL; - __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_1 = __pyx_builtin_ValueError; - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Not_possible_comparator_should_b, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Not_possible_comparator_should_b, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 294, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_10}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; + __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "constraint/parser.py":288 + /* "constraint/parser.py":317 * splitted = restriction.split(comparator) * # check if there are only pure, non-recurring variables (no operations or constants) in the restriction * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< @@ -10725,7 +10752,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality */ } - /* "constraint/parser.py":295 + /* "constraint/parser.py":324 * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") * return None # <<<<<<<<<<<<<< @@ -10736,12 +10763,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/parser.py":269 + /* "constraint/parser.py":298 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: + * ) -> AllEqualConstraint | AllDifferentConstraint | None: */ /* function exit code */ @@ -10750,7 +10777,6 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_equality_constraint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -10758,35 +10784,35 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality __Pyx_XDECREF(__pyx_v_inequalities_found); __Pyx_XDECREF(__pyx_v_comparator); __Pyx_XDECREF(__pyx_v_splitted); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator9); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator10); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/parser.py":298 +/* "constraint/parser.py":327 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< * # clean the restriction strings to functional equivalence - * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] + * restrictions_cleaned = [r.replace(" ", "") for r in restrictions] */ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *__pyx_cur_scope; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_13_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_14_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 298, __pyx_L1_error) + __PYX_ERR(0, 327, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10794,7 +10820,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CY __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_12generator10, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_genexp, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_12generator11, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_genexp, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -10810,9 +10836,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CY return __pyx_r; } -static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -10831,21 +10857,21 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 298, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 298, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 327, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 327, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 298, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 327, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_r); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_r, __pyx_t_3); @@ -10890,11 +10916,11 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator1 return __pyx_r; } -/* "constraint/parser.py":30 - * ) +/* "constraint/parser.py":32 + * * - * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< - * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 + * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Constraint | str, list[str]]]: # <<<<<<<<<<<<<< + * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 * # rewrite the restrictions so variables are singled out */ @@ -10913,10 +10939,10 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED PyObject *__pyx_v_parsed_restriction = NULL; PyObject *__pyx_v_params_used_list = NULL; PyObject *__pyx_v_finalized_constraint = NULL; - PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator10 = 0; - PyObject *__pyx_9genexpr16__pyx_v_r = NULL; - PyObject *__pyx_9genexpr17__pyx_v_r = NULL; - PyObject *__pyx_9genexpr18__pyx_v_i = NULL; + PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator11 = 0; + PyObject *__pyx_9genexpr13__pyx_v_r = NULL; + PyObject *__pyx_9genexpr14__pyx_v_r = NULL; + PyObject *__pyx_9genexpr15__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -10940,7 +10966,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 30, __pyx_L1_error) + __PYX_ERR(0, 32, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -10949,8 +10975,8 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_tune_params); __Pyx_INCREF(__pyx_v_restrictions); - /* "constraint/parser.py":33 - * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 + /* "constraint/parser.py":35 + * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 * # rewrite the restrictions so variables are singled out * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" # <<<<<<<<<<<<<< * regex_match_variable_or_constant = r"([a-zA-Z_$0-9]*)" @@ -10960,7 +10986,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9); __pyx_cur_scope->__pyx_v_regex_match_variable = __pyx_mstate_global->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9; - /* "constraint/parser.py":34 + /* "constraint/parser.py":36 * # rewrite the restrictions so variables are singled out * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" * regex_match_variable_or_constant = r"([a-zA-Z_$0-9]*)" # <<<<<<<<<<<<<< @@ -10971,111 +10997,111 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_a_zA_Z__0_9); __pyx_cur_scope->__pyx_v_regex_match_variable_or_constant = __pyx_mstate_global->__pyx_kp_u_a_zA_Z__0_9; - /* "constraint/parser.py":36 + /* "constraint/parser.py":38 * regex_match_variable_or_constant = r"([a-zA-Z_$0-9]*)" * * def replace_params(match_object): # <<<<<<<<<<<<<< * key = match_object.group(1) * if key in tune_params: */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_1replace_params, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_replac, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_1replace_params, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_replac, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":44 + /* "constraint/parser.py":46 * return key * * def replace_params_split(match_object): # <<<<<<<<<<<<<< * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_3replace_params_split, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_replac_2, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_3replace_params_split, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_replac_2, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params_split = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":54 + /* "constraint/parser.py":56 * return key * * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: # <<<<<<<<<<<<<< * """Split the restrictions into multiple restriction where possible (e.g. 3 <= x * y < 9 <= z -> [(MinProd(3), [x, y]), (MaxProd(9-1), [x, y]), (MinProd(9), [z])]).""" # noqa: E501 * split_restrictions = list() */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_restrictions, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_5to_multiple_restrictions, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_mul, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_restrictions, __pyx_mstate_global->__pyx_kp_u_list_str) < (0)) __PYX_ERR(0, 56, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_str) < (0)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_5to_multiple_restrictions, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_mul, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_to_multiple_restrictions = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/parser.py":79 + /* "constraint/parser.py":81 * return split_restrictions * - * def to_numeric_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]: # noqa: E501 + * def to_numeric_constraint(restriction: str, params: list[str]) -> MinSumConstraint | VariableMinSumConstraint | ExactSumConstraint | VariableExactSumConstraint | MaxSumConstraint | VariableMaxSumConstraint | MinProdConstraint | VariableMinProdConstraint | ExactProdConstraint | VariableExactProdConstraint | MaxProdConstraint | VariableMaxProdConstraint | None: # noqa: E501 # <<<<<<<<<<<<<< + * """Converts a restriction to a built-in numeric constraint if possible.""" + * # first check if all parameters have only numbers as values */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_restriction, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 79, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_params, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 79, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_Union_MinSumConstraint) < 0) __PYX_ERR(0, 79, __pyx_L1_error) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_7to_numeric_constraint, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_4, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_restriction, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 81, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_params, __pyx_mstate_global->__pyx_kp_u_list_str) < (0)) __PYX_ERR(0, 81, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_MinSumConstraint_VariableMinSumC) < (0)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_7to_numeric_constraint, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_3, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_1, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_to_numeric_constraint = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":269 + /* "constraint/parser.py":298 * return None * * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] - * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: + * ) -> AllEqualConstraint | AllDifferentConstraint | None: */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_restriction, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 269, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_params, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 269, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_Union_AllEqualConstrain) < 0) __PYX_ERR(0, 269, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_9to_equality_constraint, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_equ_2, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_restriction, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 298, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_params, __pyx_mstate_global->__pyx_kp_u_list_str) < (0)) __PYX_ERR(0, 298, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_AllEqualConstraint_AllDifferentC) < (0)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_9to_equality_constraint, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_equ_2, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_to_equality_constraint = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/parser.py":298 + /* "constraint/parser.py":327 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< * # clean the restriction strings to functional equivalence - * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] + * restrictions_cleaned = [r.replace(" ", "") for r in restrictions] */ - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(NULL, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(NULL, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "constraint/parser.py":300 + /* "constraint/parser.py":329 * if all(isinstance(r, str) for r in restrictions): * # clean the restriction strings to functional equivalence - * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] # <<<<<<<<<<<<<< - * restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order + * restrictions_cleaned = [r.replace(" ", "") for r in restrictions] # <<<<<<<<<<<<<< + * restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order * # get the indices of the unique restrictions, use these to build a new list of restrictions */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L6_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -11083,39 +11109,39 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 300, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 329, __pyx_L6_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_4); + __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L6_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_r, __pyx_t_5); + __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_r, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr16__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L6_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr13__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2], NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L6_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2], NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 300, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 329, __pyx_L6_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_r); __pyx_9genexpr16__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_r); __pyx_9genexpr13__pyx_v_r = 0; goto __pyx_L10_exit_scope; __pyx_L6_error:; - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_r); __pyx_9genexpr16__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_r); __pyx_9genexpr13__pyx_v_r = 0; goto __pyx_L1_error; __pyx_L10_exit_scope:; } /* exit inner scope */ __pyx_v_restrictions_cleaned = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":301 + /* "constraint/parser.py":330 * # clean the restriction strings to functional equivalence - * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] - * restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order # <<<<<<<<<<<<<< + * restrictions_cleaned = [r.replace(" ", "") for r in restrictions] + * restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order # <<<<<<<<<<<<<< * # get the indices of the unique restrictions, use these to build a new list of restrictions * restrictions_unique_indices = [restrictions_cleaned.index(r) for r in restrictions_cleaned_unique] */ @@ -11124,26 +11150,26 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_restrictions_cleaned}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_fromkeys, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fromkeys, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_restrictions_cleaned_unique = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":303 - * restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order + /* "constraint/parser.py":332 + * restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order * # get the indices of the unique restrictions, use these to build a new list of restrictions * restrictions_unique_indices = [restrictions_cleaned.index(r) for r in restrictions_cleaned_unique] # <<<<<<<<<<<<<< * restrictions = [restrictions[i] for i in restrictions_unique_indices] * */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L13_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_restrictions_cleaned_unique; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; @@ -11151,33 +11177,33 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 303, __pyx_L13_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 332, __pyx_L13_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L13_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_r, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr14__pyx_v_r, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__index, __pyx_v_restrictions_cleaned, __pyx_9genexpr17__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L13_error) + __pyx_t_6 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__index, __pyx_v_restrictions_cleaned, __pyx_9genexpr14__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 303, __pyx_L13_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 332, __pyx_L13_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_r); __pyx_9genexpr17__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_r); __pyx_9genexpr14__pyx_v_r = 0; goto __pyx_L17_exit_scope; __pyx_L13_error:; - __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_r); __pyx_9genexpr17__pyx_v_r = 0; + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_r); __pyx_9genexpr14__pyx_v_r = 0; goto __pyx_L1_error; __pyx_L17_exit_scope:; } /* exit inner scope */ __pyx_v_restrictions_unique_indices = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":304 + /* "constraint/parser.py":333 * # get the indices of the unique restrictions, use these to build a new list of restrictions * restrictions_unique_indices = [restrictions_cleaned.index(r) for r in restrictions_cleaned_unique] * restrictions = [restrictions[i] for i in restrictions_unique_indices] # <<<<<<<<<<<<<< @@ -11185,7 +11211,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * # create the parsed restrictions, split into multiple restrictions where possible */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L20_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_v_restrictions_unique_indices; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; @@ -11193,67 +11219,67 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 304, __pyx_L20_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 333, __pyx_L20_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L20_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_i, __pyx_t_6); + __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_i, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_restrictions, __pyx_9genexpr18__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L20_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_restrictions, __pyx_9genexpr15__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 304, __pyx_L20_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 333, __pyx_L20_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_i); __pyx_9genexpr18__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_i); __pyx_9genexpr15__pyx_v_i = 0; goto __pyx_L24_exit_scope; __pyx_L20_error:; - __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_i); __pyx_9genexpr18__pyx_v_i = 0; + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_i); __pyx_9genexpr15__pyx_v_i = 0; goto __pyx_L1_error; __pyx_L24_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":298 + /* "constraint/parser.py":327 * * # remove functionally duplicate restrictions (preserves order and whitespace) * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< * # clean the restriction strings to functional equivalence - * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] + * restrictions_cleaned = [r.replace(" ", "") for r in restrictions] */ } - /* "constraint/parser.py":307 + /* "constraint/parser.py":336 * * # create the parsed restrictions, split into multiple restrictions where possible * restrictions = to_multiple_restrictions(restrictions) # <<<<<<<<<<<<<< * # split into functions that only take their relevant parameters * parsed_restrictions = list() */ - __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple_restrictions(__pyx_v_to_multiple_restrictions, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple_restrictions(__pyx_v_to_multiple_restrictions, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 307, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_restrictions, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "constraint/parser.py":309 + /* "constraint/parser.py":338 * restrictions = to_multiple_restrictions(restrictions) * # split into functions that only take their relevant parameters * parsed_restrictions = list() # <<<<<<<<<<<<<< * for res in restrictions: * params_used: set[str] = set() */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_parsed_restrictions = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":310 + /* "constraint/parser.py":339 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -11262,7 +11288,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ if (unlikely(__pyx_v_restrictions == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 310, __pyx_L1_error) + __PYX_ERR(0, 339, __pyx_L1_error) } __pyx_t_2 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; @@ -11270,32 +11296,32 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 310, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 339, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_4); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_res, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":311 + /* "constraint/parser.py":340 * parsed_restrictions = list() * for res in restrictions: * params_used: set[str] = set() # <<<<<<<<<<<<<< * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() * params_used_list = list(params_used) */ - __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_params_used); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_params_used, ((PyObject*)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":312 + /* "constraint/parser.py":341 * for res in restrictions: * params_used: set[str] = set() * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() # <<<<<<<<<<<<<< @@ -11303,9 +11329,9 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * finalized_constraint = None */ __pyx_t_8 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_sub); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_sub); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_7 = 1; @@ -11322,10 +11348,10 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED #endif { PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_regex_match_variable, __pyx_v_replace_params_split, __pyx_v_res}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __pyx_t_5; @@ -11333,28 +11359,28 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_t_7 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_parsed_restriction, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":313 + /* "constraint/parser.py":342 * params_used: set[str] = set() * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() * params_used_list = list(params_used) # <<<<<<<<<<<<<< * finalized_constraint = None * if " or " not in res and " and " not in res: */ - __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_params_used); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_params_used); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_params_used_list, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "constraint/parser.py":314 + /* "constraint/parser.py":343 * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() * params_used_list = list(params_used) * finalized_constraint = None # <<<<<<<<<<<<<< @@ -11364,25 +11390,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_finalized_constraint, Py_None); - /* "constraint/parser.py":315 + /* "constraint/parser.py":344 * params_used_list = list(params_used) * finalized_constraint = None * if " or " not in res and " and " not in res: # <<<<<<<<<<<<<< * # if applicable, strip the outermost round brackets * while ( */ - __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u_or, __pyx_v_res, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u_or, __pyx_v_res, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 344, __pyx_L1_error) if (__pyx_t_11) { } else { __pyx_t_3 = __pyx_t_11; goto __pyx_L28_bool_binop_done; } - __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u_and, __pyx_v_res, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 315, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u_and, __pyx_v_res, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 344, __pyx_L1_error) __pyx_t_3 = __pyx_t_11; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { - /* "constraint/parser.py":317 + /* "constraint/parser.py":346 * if " or " not in res and " and " not in res: * # if applicable, strip the outermost round brackets * while ( # <<<<<<<<<<<<<< @@ -11391,16 +11417,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ while (1) { - /* "constraint/parser.py":318 + /* "constraint/parser.py":347 * # if applicable, strip the outermost round brackets * while ( * parsed_restriction[0] == "(" # <<<<<<<<<<<<<< * and parsed_restriction[-1] == ")" * and "(" not in parsed_restriction[1:] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__19, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11408,16 +11434,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":319 + /* "constraint/parser.py":348 * while ( * parsed_restriction[0] == "(" * and parsed_restriction[-1] == ")" # <<<<<<<<<<<<<< * and "(" not in parsed_restriction[1:] * and ")" not in parsed_restriction[:1] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__20, Py_EQ)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11425,16 +11451,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":320 + /* "constraint/parser.py":349 * parsed_restriction[0] == "(" * and parsed_restriction[-1] == ")" * and "(" not in parsed_restriction[1:] # <<<<<<<<<<<<<< * and ")" not in parsed_restriction[:1] * ): */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parsed_restriction, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parsed_restriction, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__19, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__19, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_11) { } else { @@ -11442,48 +11468,51 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED goto __pyx_L32_bool_binop_done; } - /* "constraint/parser.py":321 + /* "constraint/parser.py":350 * and parsed_restriction[-1] == ")" * and "(" not in parsed_restriction[1:] * and ")" not in parsed_restriction[:1] # <<<<<<<<<<<<<< * ): * parsed_restriction = parsed_restriction[1:-1] */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parsed_restriction, 0, 1, NULL, NULL, &__pyx_mstate_global->__pyx_slice[2], 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parsed_restriction, 0, 1, NULL, NULL, &__pyx_mstate_global->__pyx_slice[2], 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__20, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__20, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_11; __pyx_L32_bool_binop_done:; if (!__pyx_t_3) break; - /* "constraint/parser.py":323 + /* "constraint/parser.py":352 * and ")" not in parsed_restriction[:1] * ): * parsed_restriction = parsed_restriction[1:-1] # <<<<<<<<<<<<<< * # check if we can turn this into the built-in numeric comparison constraint * finalized_constraint = to_numeric_constraint(parsed_restriction, params_used_list) */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parsed_restriction, 1, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[3], 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parsed_restriction, 1, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[3], 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_parsed_restriction, __pyx_t_1); __pyx_t_1 = 0; } - /* "constraint/parser.py":325 + /* "constraint/parser.py":354 * parsed_restriction = parsed_restriction[1:-1] * # check if we can turn this into the built-in numeric comparison constraint * finalized_constraint = to_numeric_constraint(parsed_restriction, params_used_list) # <<<<<<<<<<<<<< * if finalized_constraint is None: * # check if we can turn this into the built-in equality comparison constraint */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 325, __pyx_L1_error) - __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(__pyx_v_to_numeric_constraint, ((PyObject*)__pyx_v_parsed_restriction), __pyx_v_params_used_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_1 = __pyx_v_parsed_restriction; + __Pyx_INCREF(__pyx_t_1); + if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_5 = __pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(__pyx_v_to_numeric_constraint, ((PyObject*)__pyx_t_1), __pyx_v_params_used_list); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_5); + __pyx_t_5 = 0; - /* "constraint/parser.py":326 + /* "constraint/parser.py":355 * # check if we can turn this into the built-in numeric comparison constraint * finalized_constraint = to_numeric_constraint(parsed_restriction, params_used_list) * if finalized_constraint is None: # <<<<<<<<<<<<<< @@ -11493,20 +11522,23 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_t_3 = (__pyx_v_finalized_constraint == Py_None); if (__pyx_t_3) { - /* "constraint/parser.py":328 + /* "constraint/parser.py":357 * if finalized_constraint is None: * # check if we can turn this into the built-in equality comparison constraint * finalized_constraint = to_equality_constraint(parsed_restriction, params_used_list) # <<<<<<<<<<<<<< * if finalized_constraint is None: * # we must turn it into a general function */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 328, __pyx_L1_error) - __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality_constraint(__pyx_v_to_equality_constraint, ((PyObject*)__pyx_v_parsed_restriction), __pyx_v_params_used_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_5 = __pyx_v_parsed_restriction; + __Pyx_INCREF(__pyx_t_5); + if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_5))) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality_constraint(__pyx_v_to_equality_constraint, ((PyObject*)__pyx_t_5), __pyx_v_params_used_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":326 + /* "constraint/parser.py":355 * # check if we can turn this into the built-in numeric comparison constraint * finalized_constraint = to_numeric_constraint(parsed_restriction, params_used_list) * if finalized_constraint is None: # <<<<<<<<<<<<<< @@ -11515,7 +11547,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":315 + /* "constraint/parser.py":344 * params_used_list = list(params_used) * finalized_constraint = None * if " or " not in res and " and " not in res: # <<<<<<<<<<<<<< @@ -11524,7 +11556,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":329 + /* "constraint/parser.py":358 * # check if we can turn this into the built-in equality comparison constraint * finalized_constraint = to_equality_constraint(parsed_restriction, params_used_list) * if finalized_constraint is None: # <<<<<<<<<<<<<< @@ -11534,16 +11566,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_t_3 = (__pyx_v_finalized_constraint == Py_None); if (__pyx_t_3) { - /* "constraint/parser.py":331 + /* "constraint/parser.py":360 * if finalized_constraint is None: * # we must turn it into a general function * finalized_constraint = f"def r({', '.join(params_used_list)}): return {parsed_restriction} \n" # <<<<<<<<<<<<<< * parsed_restrictions.append((finalized_constraint, params_used_list)) * */ - __pyx_t_1 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__21, __pyx_v_params_used_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_1 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__21, __pyx_v_params_used_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_parsed_restriction, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_parsed_restriction, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_def_r; __pyx_t_12[1] = __pyx_t_1; @@ -11551,14 +11583,14 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __pyx_t_12[3] = __pyx_t_5; __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u__22; __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_12, 5, 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5)); - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_6); __pyx_t_6 = 0; - /* "constraint/parser.py":329 + /* "constraint/parser.py":358 * # check if we can turn this into the built-in equality comparison constraint * finalized_constraint = to_equality_constraint(parsed_restriction, params_used_list) * if finalized_constraint is None: # <<<<<<<<<<<<<< @@ -11567,25 +11599,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED */ } - /* "constraint/parser.py":332 + /* "constraint/parser.py":361 * # we must turn it into a general function * finalized_constraint = f"def r({', '.join(params_used_list)}): return {parsed_restriction} \n" * parsed_restrictions.append((finalized_constraint, params_used_list)) # <<<<<<<<<<<<<< * * return parsed_restrictions */ - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_finalized_constraint); __Pyx_GIVEREF(__pyx_v_finalized_constraint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_finalized_constraint) != (0)) __PYX_ERR(0, 332, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_finalized_constraint) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); __Pyx_INCREF(__pyx_v_params_used_list); __Pyx_GIVEREF(__pyx_v_params_used_list); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_params_used_list) != (0)) __PYX_ERR(0, 332, __pyx_L1_error); - __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_parsed_restrictions, __pyx_t_6); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 332, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_params_used_list) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); + __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_parsed_restrictions, __pyx_t_6); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/parser.py":310 + /* "constraint/parser.py":339 * # split into functions that only take their relevant parameters * parsed_restrictions = list() * for res in restrictions: # <<<<<<<<<<<<<< @@ -11595,23 +11627,23 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/parser.py":334 + /* "constraint/parser.py":363 * parsed_restrictions.append((finalized_constraint, params_used_list)) * * return parsed_restrictions # <<<<<<<<<<<<<< * - * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 + * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_parsed_restrictions); __pyx_r = __pyx_v_parsed_restrictions; goto __pyx_L0; - /* "constraint/parser.py":30 - * ) + /* "constraint/parser.py":32 * - * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< - * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 + * + * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Constraint | str, list[str]]]: # <<<<<<<<<<<<<< + * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 * # rewrite the restrictions so variables are singled out */ @@ -11640,10 +11672,10 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __Pyx_XDECREF(__pyx_v_parsed_restriction); __Pyx_XDECREF(__pyx_v_params_used_list); __Pyx_XDECREF(__pyx_v_finalized_constraint); - __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_12generator10); - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_r); - __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_r); - __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_i); + __Pyx_XDECREF(__pyx_gb_10constraint_6parser_18parse_restrictions_12generator11); + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_r); + __Pyx_XDECREF(__pyx_9genexpr14__pyx_v_r); + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_i); __Pyx_XDECREF(__pyx_v_restrictions); __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -11651,12 +11683,12 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED return __pyx_r; } -/* "constraint/parser.py":336 - * return parsed_restrictions +/* "constraint/parser.py":366 * - * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< - * """Parses constraints in string format (referred to as restrictions) from a list of strings into a list of Constraints, parameters used, and source if applicable. * + * def compile_to_constraints( # <<<<<<<<<<<<<< + * constraints: list[str], domains: dict, picklable=False + * ) -> list[tuple[Constraint, list[str], str | None]]: # noqa: E501 */ /* Python wrapper */ @@ -11701,41 +11733,49 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_picklable,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 336, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 366, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 366, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 366, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 366, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "compile_to_constraints", 0) < 0) __PYX_ERR(0, 336, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "compile_to_constraints", 0) < (0)) __PYX_ERR(0, 366, __pyx_L3_error) + + /* "constraint/parser.py":367 + * + * def compile_to_constraints( + * constraints: list[str], domains: dict, picklable=False # <<<<<<<<<<<<<< + * ) -> list[tuple[Constraint, list[str], str | None]]: # noqa: E501 + * """Parses constraints in string format (referred to as restrictions) from a list of strings into a list of Constraints, parameters used, and source if applicable. +*/ if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, i); __PYX_ERR(0, 336, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, i); __PYX_ERR(0, 366, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 366, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 366, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 336, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 366, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -11747,7 +11787,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 336, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compile_to_constraints", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 366, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11758,10 +11798,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 336, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 336, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 367, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 367, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_2compile_to_constraints(__pyx_self, __pyx_v_constraints, __pyx_v_domains, __pyx_v_picklable); + /* "constraint/parser.py":366 + * + * + * def compile_to_constraints( # <<<<<<<<<<<<<< + * constraints: list[str], domains: dict, picklable=False + * ) -> list[tuple[Constraint, list[str], str | None]]: # noqa: E501 +*/ + /* function exit code */ goto __pyx_L0; __pyx_L1_error:; @@ -11802,21 +11850,20 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN PyObject *__pyx_t_11 = NULL; int __pyx_t_12; PyObject *__pyx_t_13[4]; - PyObject *__pyx_t_14 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compile_to_constraints", 0); - /* "constraint/parser.py":347 + /* "constraint/parser.py":379 * list of tuples with restrictions, parameters used (list[str]), and source (str) if applicable. Returned restrictions are strings, functions, or Constraints depending on the options provided. - * """ # noqa: E501 + * """ # noqa: E501 * parsed_restrictions = parse_restrictions(constraints, domains) # <<<<<<<<<<<<<< - * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() + * compiled_constraints: list[tuple[Constraint, list[str], str | None]] = list() * for restriction, params_used in parsed_restrictions: */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_parse_restrictions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_parse_restrictions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -11832,30 +11879,30 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_constraints, __pyx_v_domains}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_parsed_restrictions = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/parser.py":348 - * """ # noqa: E501 + /* "constraint/parser.py":380 + * """ # noqa: E501 * parsed_restrictions = parse_restrictions(constraints, domains) - * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() # <<<<<<<<<<<<<< + * compiled_constraints: list[tuple[Constraint, list[str], str | None]] = list() # <<<<<<<<<<<<<< * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_compiled_constraints = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":349 + /* "constraint/parser.py":381 * parsed_restrictions = parse_restrictions(constraints, domains) - * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() + * compiled_constraints: list[tuple[Constraint, list[str], str | None]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint @@ -11865,9 +11912,9 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parsed_restrictions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parsed_restrictions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 381, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -11875,17 +11922,17 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 349, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 381, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 349, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 381, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -11896,13 +11943,13 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 349, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 349, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 381, __pyx_L1_error) PyErr_Clear(); } break; @@ -11915,7 +11962,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 349, __pyx_L1_error) + __PYX_ERR(0, 381, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -11924,23 +11971,23 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); } #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); @@ -11948,7 +11995,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 349, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < (0)) __PYX_ERR(0, 381, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; @@ -11956,7 +12003,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 349, __pyx_L1_error) + __PYX_ERR(0, 381, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_restriction, __pyx_t_2); @@ -11964,8 +12011,8 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_XDECREF_SET(__pyx_v_params_used, __pyx_t_7); __pyx_t_7 = 0; - /* "constraint/parser.py":350 - * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() + /* "constraint/parser.py":382 + * compiled_constraints: list[tuple[Constraint, list[str], str | None]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< * # if it's a string, wrap it in a (compilable or compiled) function constraint @@ -11974,17 +12021,17 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __pyx_t_10 = PyUnicode_Check(__pyx_v_restriction); if (__pyx_t_10) { - /* "constraint/parser.py":352 + /* "constraint/parser.py":384 * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: # <<<<<<<<<<<<<< * constraint = CompilableFunctionConstraint(restriction) * else: */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 384, __pyx_L1_error) if (__pyx_t_10) { - /* "constraint/parser.py":353 + /* "constraint/parser.py":385 * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: * constraint = CompilableFunctionConstraint(restriction) # <<<<<<<<<<<<<< @@ -11992,7 +12039,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * code_object = compile(restriction, "", "exec") */ __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS @@ -12008,16 +12055,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_restriction}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":352 + /* "constraint/parser.py":384 * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: # <<<<<<<<<<<<<< @@ -12027,7 +12074,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L8; } - /* "constraint/parser.py":355 + /* "constraint/parser.py":387 * constraint = CompilableFunctionConstraint(restriction) * else: * code_object = compile(restriction, "", "exec") # <<<<<<<<<<<<<< @@ -12036,90 +12083,87 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN */ /*else*/ { __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_compile); - __pyx_t_7 = __pyx_builtin_compile; __pyx_t_4 = 1; { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_restriction, __pyx_mstate_global->__pyx_kp_u_string, __pyx_mstate_global->__pyx_n_u_exec}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_compile, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_code_object, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":356 + /* "constraint/parser.py":388 * else: * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) # <<<<<<<<<<<<<< * constraint = FunctionConstraint(func) * compiled_constraints.append((constraint, params_used, restriction)) */ - __pyx_t_7 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_code_object, __pyx_mstate_global->__pyx_n_u_co_consts); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 388, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_code_object, __pyx_mstate_global->__pyx_n_u_co_consts); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_Globals(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_8 = __Pyx_Globals(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_7); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_7, __pyx__function); __pyx_t_4 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_11, __pyx_t_8}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_11, __pyx_t_8}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":357 + /* "constraint/parser.py":389 * code_object = compile(restriction, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) * constraint = FunctionConstraint(func) # <<<<<<<<<<<<<< * compiled_constraints.append((constraint, params_used, restriction)) * elif isinstance(restriction, Constraint): */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); - assert(__pyx_t_2); + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_7); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); __pyx_t_4 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_func}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_func}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_3); @@ -12127,29 +12171,29 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __pyx_L8:; - /* "constraint/parser.py":358 + /* "constraint/parser.py":390 * func = FunctionType(code_object.co_consts[0], globals()) * constraint = FunctionConstraint(func) * compiled_constraints.append((constraint, params_used, restriction)) # <<<<<<<<<<<<<< * elif isinstance(restriction, Constraint): * # otherwise it already is a Constraint, pass it directly */ - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_constraint); __Pyx_GIVEREF(__pyx_v_constraint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 358, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 390, __pyx_L1_error); __Pyx_INCREF(__pyx_v_params_used); __Pyx_GIVEREF(__pyx_v_params_used); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 358, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 390, __pyx_L1_error); __Pyx_INCREF(__pyx_v_restriction); __Pyx_GIVEREF(__pyx_v_restriction); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_restriction) != (0)) __PYX_ERR(0, 358, __pyx_L1_error); - __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_compiled_constraints, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 358, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_restriction) != (0)) __PYX_ERR(0, 390, __pyx_L1_error); + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_compiled_constraints, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":350 - * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() + /* "constraint/parser.py":382 + * compiled_constraints: list[tuple[Constraint, list[str], str | None]] = list() * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): # <<<<<<<<<<<<<< * # if it's a string, wrap it in a (compilable or compiled) function constraint @@ -12158,41 +12202,41 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":359 + /* "constraint/parser.py":391 * constraint = FunctionConstraint(func) * compiled_constraints.append((constraint, params_used, restriction)) * elif isinstance(restriction, Constraint): # <<<<<<<<<<<<<< * # otherwise it already is a Constraint, pass it directly * compiled_constraints.append((restriction, params_used, None)) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyObject_IsInstance(__pyx_v_restriction, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_10 = PyObject_IsInstance(__pyx_v_restriction, __pyx_t_3); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_10)) { - /* "constraint/parser.py":361 + /* "constraint/parser.py":393 * elif isinstance(restriction, Constraint): * # otherwise it already is a Constraint, pass it directly * compiled_constraints.append((restriction, params_used, None)) # <<<<<<<<<<<<<< * else: * raise ValueError(f"Restriction {restriction} is neither a string or Constraint {type(restriction)}") */ - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_restriction); __Pyx_GIVEREF(__pyx_v_restriction); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_restriction) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_restriction) != (0)) __PYX_ERR(0, 393, __pyx_L1_error); __Pyx_INCREF(__pyx_v_params_used); __Pyx_GIVEREF(__pyx_v_params_used); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 393, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); - __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_compiled_constraints, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 361, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None) != (0)) __PYX_ERR(0, 393, __pyx_L1_error); + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_compiled_constraints, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":359 + /* "constraint/parser.py":391 * constraint = FunctionConstraint(func) * compiled_constraints.append((constraint, params_used, restriction)) * elif isinstance(restriction, Constraint): # <<<<<<<<<<<<<< @@ -12202,7 +12246,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN goto __pyx_L7; } - /* "constraint/parser.py":363 + /* "constraint/parser.py":395 * compiled_constraints.append((restriction, params_used, None)) * else: * raise ValueError(f"Restriction {restriction} is neither a string or Constraint {type(restriction)}") # <<<<<<<<<<<<<< @@ -12211,40 +12255,37 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN */ /*else*/ { __pyx_t_8 = NULL; - __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_2 = __pyx_builtin_ValueError; - __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_restriction, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_restriction)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_restriction, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_restriction)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Restriction; - __pyx_t_13[1] = __pyx_t_11; + __pyx_t_13[1] = __pyx_t_7; __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u_is_neither_a_string_or_Constrai; - __pyx_t_13[3] = __pyx_t_7; - __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_13, 4, 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 35 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 363, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_13[3] = __pyx_t_11; + __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_13, 4, 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 35 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11)); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_4 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_14}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 363, __pyx_L1_error) + __PYX_ERR(0, 395, __pyx_L1_error) } __pyx_L7:; - /* "constraint/parser.py":349 + /* "constraint/parser.py":381 * parsed_restrictions = parse_restrictions(constraints, domains) - * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() + * compiled_constraints: list[tuple[Constraint, list[str], str | None]] = list() * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint @@ -12252,22 +12293,24 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/parser.py":366 + /* "constraint/parser.py":398 * * # return the restrictions and used parameters * return compiled_constraints # <<<<<<<<<<<<<< + * + * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_compiled_constraints); __pyx_r = __pyx_v_compiled_constraints; goto __pyx_L0; - /* "constraint/parser.py":336 - * return parsed_restrictions + /* "constraint/parser.py":366 * - * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< - * """Parses constraints in string format (referred to as restrictions) from a list of strings into a list of Constraints, parameters used, and source if applicable. * + * def compile_to_constraints( # <<<<<<<<<<<<<< + * constraints: list[str], domains: dict, picklable=False + * ) -> list[tuple[Constraint, list[str], str | None]]: # noqa: E501 */ /* function exit code */ @@ -12278,7 +12321,6 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("constraint.parser.compile_to_constraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -12293,117 +12335,720 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* #### Code section: module_exttypes ### */ -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else - #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions)); - (void) PyObject_INIT(o, t); - PyObject_GC_Track(o); - } else - #endif - { - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - } - #endif - return o; -} +/* "constraint/parser.py":404 + * + * + * def is_or_evals_to_number(s: str) -> int | float | None: # <<<<<<<<<<<<<< + * """Check if the string is a number or can be evaluated to a number.""" + * try: +*/ -static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyObject *o) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)o; - #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_restrictions) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - } +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_6parser_5is_or_evals_to_number(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10constraint_6parser_4is_or_evals_to_number, "Check if the string is a number or can be evaluated to a number."); +static PyMethodDef __pyx_mdef_10constraint_6parser_5is_or_evals_to_number = {"is_or_evals_to_number", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_5is_or_evals_to_number, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_4is_or_evals_to_number}; +static PyObject *__pyx_pw_10constraint_6parser_5is_or_evals_to_number(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_s = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_v_params_used); - Py_CLEAR(p->__pyx_v_regex_match_variable); - Py_CLEAR(p->__pyx_v_regex_match_variable_or_constant); - Py_CLEAR(p->__pyx_v_tune_params); - #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)o); - } else + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("is_or_evals_to_number (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_SIZE + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); - #else - { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); - if (tp_free) tp_free(o); + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 404, __pyx_L3_error) + if (__pyx_kwds_len > 0) { + switch (__pyx_nargs) { + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 404, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "is_or_evals_to_number", 0) < (0)) __PYX_ERR(0, 404, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_or_evals_to_number", 1, 1, 1, i); __PYX_ERR(0, 404, __pyx_L3_error) } + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 404, __pyx_L3_error) } - #endif + __pyx_v_s = ((PyObject*)values[0]); } -} - -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)o; - { - e = __Pyx_call_type_traverse(o, 1, v, a); - if (e) return e; + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("is_or_evals_to_number", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 404, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } - if (p->__pyx_v_params_used) { - e = (*v)(p->__pyx_v_params_used, a); if (e) return e; + __Pyx_AddTraceback("constraint.parser.is_or_evals_to_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PyUnicode_Type), 0, "s", 2))) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_r = __pyx_pf_10constraint_6parser_4is_or_evals_to_number(__pyx_self, __pyx_v_s); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } - if (p->__pyx_v_tune_params) { - e = (*v)(p->__pyx_v_tune_params, a); if (e) return e; + goto __pyx_L7_cleaned_up; + __pyx_L0:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } - return 0; -} - -static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)o; - tmp = ((PyObject*)p->__pyx_v_params_used); - p->__pyx_v_params_used = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->__pyx_v_tune_params); - p->__pyx_v_tune_params = ((PyObject*)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; + __pyx_L7_cleaned_up:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -#if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_restrictions}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct__parse_restrictions}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_6parser___pyx_scope_struct__parse_restrictions}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions}, - {0, 0}, -}; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_spec = { - "constraint.parser.__pyx_scope_struct__parse_restrictions", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions), - 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_slots, -}; -#else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions = { - PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct__parse_restrictions", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_restrictions, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ +static PyObject *__pyx_pf_10constraint_6parser_4is_or_evals_to_number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) { + PyObject *__pyx_v_number = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + size_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("is_or_evals_to_number", 0); + + /* "constraint/parser.py":406 + * def is_or_evals_to_number(s: str) -> int | float | None: + * """Check if the string is a number or can be evaluated to a number.""" + * try: # <<<<<<<<<<<<<< + * # check if it's a number or solvable to a number (e.g. '32*2') + * number = eval(s) +*/ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + /*try:*/ { + + /* "constraint/parser.py":408 + * try: + * # check if it's a number or solvable to a number (e.g. '32*2') + * number = eval(s) # <<<<<<<<<<<<<< + * assert isinstance(number, (int, float)) + * return number +*/ + __pyx_t_5 = NULL; + __pyx_t_6 = __Pyx_Globals(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_v_number) { + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_number, __pyx_v_number) < (0)) __PYX_ERR(0, 408, __pyx_L3_error) + } + if (__pyx_v_s) { + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_s, __pyx_v_s) < (0)) __PYX_ERR(0, 408, __pyx_L3_error) + } + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_s, __pyx_t_6, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_eval, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + } + __pyx_v_number = __pyx_t_4; + __pyx_t_4 = 0; + + /* "constraint/parser.py":409 + * # check if it's a number or solvable to a number (e.g. '32*2') + * number = eval(s) + * assert isinstance(number, (int, float)) # <<<<<<<<<<<<<< + * return number + * except Exception: +*/ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_10 = PyLong_Check(__pyx_v_number); + if (!__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_10 = PyFloat_Check(__pyx_v_number); + __pyx_t_9 = __pyx_t_10; + __pyx_L9_bool_binop_done:; + if (unlikely(!__pyx_t_9)) { + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0); + __PYX_ERR(0, 409, __pyx_L3_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 409, __pyx_L3_error) + #endif + + /* "constraint/parser.py":410 + * number = eval(s) + * assert isinstance(number, (int, float)) + * return number # <<<<<<<<<<<<<< + * except Exception: + * # it's not a solvable subexpression, return None +*/ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_number); + __pyx_r = __pyx_v_number; + goto __pyx_L7_try_return; + + /* "constraint/parser.py":406 + * def is_or_evals_to_number(s: str) -> int | float | None: + * """Check if the string is a number or can be evaluated to a number.""" + * try: # <<<<<<<<<<<<<< + * # check if it's a number or solvable to a number (e.g. '32*2') + * number = eval(s) +*/ + } + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "constraint/parser.py":411 + * assert isinstance(number, (int, float)) + * return number + * except Exception: # <<<<<<<<<<<<<< + * # it's not a solvable subexpression, return None + * return None +*/ + __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); + if (__pyx_t_11) { + __Pyx_ErrRestore(0,0,0); + + /* "constraint/parser.py":413 + * except Exception: + * # it's not a solvable subexpression, return None + * return None # <<<<<<<<<<<<<< + * + * +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L6_except_return; + } + goto __pyx_L5_except_error; + + /* "constraint/parser.py":406 + * def is_or_evals_to_number(s: str) -> int | float | None: + * """Check if the string is a number or can be evaluated to a number.""" + * try: # <<<<<<<<<<<<<< + * # check if it's a number or solvable to a number (e.g. '32*2') + * number = eval(s) +*/ + __pyx_L5_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L1_error; + __pyx_L7_try_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + __pyx_L6_except_return:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_2); + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); + goto __pyx_L0; + } + + /* "constraint/parser.py":404 + * + * + * def is_or_evals_to_number(s: str) -> int | float | None: # <<<<<<<<<<<<<< + * """Check if the string is a number or can be evaluated to a number.""" + * try: +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("constraint.parser.is_or_evals_to_number", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_number); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "constraint/parser.py":416 + * + * + * def extract_operators(expr: str) -> list[str]: # <<<<<<<<<<<<<< + * """Extracts all operators from an expression string.""" + * # Regex for all supported binary operators: +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_10constraint_6parser_7extract_operators(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10constraint_6parser_6extract_operators, "Extracts all operators from an expression string."); +static PyMethodDef __pyx_mdef_10constraint_6parser_7extract_operators = {"extract_operators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_6parser_7extract_operators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_6parser_6extract_operators}; +static PyObject *__pyx_pw_10constraint_6parser_7extract_operators(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_expr = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("extract_operators (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_SIZE + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif - #if PY_VERSION_HEX >= 0x030800b4 - 0, /*tp_vectorcall_offset*/ #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_expr,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 416, __pyx_L3_error) + if (__pyx_kwds_len > 0) { + switch (__pyx_nargs) { + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 416, __pyx_L3_error) + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "extract_operators", 0) < (0)) __PYX_ERR(0, 416, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("extract_operators", 1, 1, 1, i); __PYX_ERR(0, 416, __pyx_L3_error) } + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 416, __pyx_L3_error) + } + __pyx_v_expr = ((PyObject*)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("extract_operators", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 416, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __Pyx_AddTraceback("constraint.parser.extract_operators", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_expr), (&PyUnicode_Type), 0, "expr", 2))) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_r = __pyx_pf_10constraint_6parser_6extract_operators(__pyx_self, __pyx_v_expr); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + goto __pyx_L7_cleaned_up; + __pyx_L0:; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + __pyx_L7_cleaned_up:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10constraint_6parser_6extract_operators(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_expr) { + PyObject *__pyx_v_pattern = NULL; + PyObject *__pyx_v_matches = NULL; + PyObject *__pyx_9genexpr16__pyx_v_m = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + size_t __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("extract_operators", 0); + __Pyx_INCREF(__pyx_v_expr); + + /* "constraint/parser.py":422 + * + * # remove any whitespace from the expression + * expr = expr.strip().replace(" ", "") # <<<<<<<<<<<<<< + * + * # Match ** first to avoid matching * twice +*/ + __pyx_t_1 = __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyUnicode_Type__strip, __pyx_v_expr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyUnicode_Replace(((PyObject*)__pyx_t_1), __pyx_mstate_global->__pyx_kp_u__17, __pyx_mstate_global->__pyx_kp_u__18, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF_SET(__pyx_v_expr, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "constraint/parser.py":425 + * + * # Match ** first to avoid matching * twice + * pattern = r""" # <<<<<<<<<<<<<< + * (?__pyx_kp_u_match_but_not_w_d_binary_preced); + __pyx_v_pattern = __pyx_mstate_global->__pyx_kp_u_match_but_not_w_d_binary_preced; + + /* "constraint/parser.py":430 + * [+\*[inserted by cython to avoid comment closer]/] # match +, *, / + * """ + * matches = re.findall(pattern, expr, re.VERBOSE) # <<<<<<<<<<<<<< + * return [m.strip() for m in matches] +*/ + __pyx_t_1 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VERBOSE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_1); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_6 = 0; + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_v_pattern, __pyx_v_expr, __pyx_t_5}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + } + __pyx_v_matches = __pyx_t_2; + __pyx_t_2 = 0; + + /* "constraint/parser.py":431 + * """ + * matches = re.findall(pattern, expr, re.VERBOSE) + * return [m.strip() for m in matches] # <<<<<<<<<<<<<< +*/ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_v_matches)) || PyTuple_CheckExact(__pyx_v_matches)) { + __pyx_t_4 = __pyx_v_matches; __Pyx_INCREF(__pyx_t_4); + __pyx_t_7 = 0; + __pyx_t_8 = NULL; + } else { + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_matches); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 431, __pyx_L5_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 431, __pyx_L5_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_7, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_7; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 431, __pyx_L5_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7)); + #else + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); + #endif + ++__pyx_t_7; + } + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L5_error) + } else { + __pyx_t_5 = __pyx_t_8(__pyx_t_4); + if (unlikely(!__pyx_t_5)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 431, __pyx_L5_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_5); + __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_m, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_1 = __pyx_9genexpr16__pyx_v_m; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_6 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; + __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_5); + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 431, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_m); __pyx_9genexpr16__pyx_v_m = 0; + goto __pyx_L9_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_m); __pyx_9genexpr16__pyx_v_m = 0; + goto __pyx_L1_error; + __pyx_L9_exit_scope:; + } /* exit inner scope */ + __pyx_r = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "constraint/parser.py":416 + * + * + * def extract_operators(expr: str) -> list[str]: # <<<<<<<<<<<<<< + * """Extracts all operators from an expression string.""" + * # Regex for all supported binary operators: +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("constraint.parser.extract_operators", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_pattern); + __Pyx_XDECREF(__pyx_v_matches); + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_m); + __Pyx_XDECREF(__pyx_v_expr); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +/* #### Code section: module_exttypes ### */ + +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_USE_FREELISTS + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else + (void) PyObject_INIT(o, t); + #endif + PyObject_GC_Track(o); + } else + #endif + { + o = __Pyx_AllocateExtensionType(t, 1); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyObject *o) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_restrictions) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_params_used); + Py_CLEAR(p->__pyx_v_regex_match_variable); + Py_CLEAR(p->__pyx_v_regex_match_variable_or_constant); + Py_CLEAR(p->__pyx_v_tune_params); + #if CYTHON_USE_FREELISTS + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)o); + } else + #endif + { + PyTypeObject *tp = Py_TYPE(o); + #if CYTHON_USE_TYPE_SLOTS + (*tp->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif + } +} + +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } + if (p->__pyx_v_params_used) { + e = (*v)(p->__pyx_v_params_used, a); if (e) return e; + } + if (p->__pyx_v_tune_params) { + e = (*v)(p->__pyx_v_tune_params, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)o; + tmp = ((PyObject*)p->__pyx_v_params_used); + p->__pyx_v_params_used = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_tune_params); + p->__pyx_v_tune_params = ((PyObject*)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_restrictions}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct__parse_restrictions}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_6parser___pyx_scope_struct__parse_restrictions}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_spec = { + "constraint.parser.__pyx_scope_struct__parse_restrictions", + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.parser.""__pyx_scope_struct__parse_restrictions", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_restrictions, /*tp_dealloc*/ + 0, /*tp_vectorcall_offset*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -12417,7 +13062,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct__parse_restrictions, /*tp_traverse*/ __pyx_tp_clear_10constraint_6parser___pyx_scope_struct__parse_restrictions, /*tp_clear*/ @@ -12452,7 +13097,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -12472,30 +13117,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyObject *o) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -12507,19 +13155,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeri Py_CLEAR(p->__pyx_v_params); Py_CLEAR(p->__pyx_v_variable_supported_operators); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -12574,7 +13227,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numer "constraint.parser.__pyx_scope_struct_1_to_numeric_constraint", sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_slots, }; #else @@ -12585,12 +13238,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -12604,7 +13252,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, /*tp_traverse*/ __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, /*tp_clear*/ @@ -12639,7 +13287,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -12659,30 +13307,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_2_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr(PyObject *o) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -12694,19 +13345,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr(P Py_CLEAR(p->__pyx_v_genexpr); Py_CLEAR(p->__pyx_v_p); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_2_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -12742,7 +13398,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_ "constraint.parser.__pyx_scope_struct_2_genexpr", sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_slots, }; #else @@ -12753,12 +13409,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -12772,7 +13423,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -12807,7 +13458,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -12827,30 +13478,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_3_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr(PyObject *o) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -12860,19 +13514,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr(P Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_v); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_3_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -12902,7 +13561,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_ "constraint.parser.__pyx_scope_struct_3_genexpr", sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_slots, }; #else @@ -12913,12 +13572,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -12932,7 +13586,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -12967,7 +13621,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -12987,30 +13641,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_4_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr(PyObject *o) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -13022,19 +13679,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr(P Py_CLEAR(p->__pyx_v_s); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_4_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -13067,7 +13729,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_ "constraint.parser.__pyx_scope_struct_4_genexpr", sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_slots, }; #else @@ -13078,12 +13740,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -13097,7 +13754,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -13132,7 +13789,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -13152,30 +13809,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_5_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr(PyObject *o) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -13187,19 +13847,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr(P Py_CLEAR(p->__pyx_v_s); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_5_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -13232,7 +13897,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_ "constraint.parser.__pyx_scope_struct_5_genexpr", sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_slots, }; #else @@ -13243,12 +13908,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -13262,7 +13922,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -13297,7 +13957,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -13317,30 +13977,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr(PyObject *o) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -13349,21 +14012,26 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr(P PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_s); + Py_CLEAR(p->__pyx_v_var); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -13380,8 +14048,8 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr(P if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } - if (p->__pyx_v_s) { - e = (*v)(p->__pyx_v_s, a); if (e) return e; + if (p->__pyx_v_var) { + e = (*v)(p->__pyx_v_var, a); if (e) return e; } return 0; } @@ -13396,7 +14064,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_ "constraint.parser.__pyx_scope_struct_6_genexpr", sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_slots, }; #else @@ -13407,12 +14075,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -13426,7 +14089,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -13461,7 +14124,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -13481,30 +14144,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_7_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr(PyObject *o) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -13515,19 +14181,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr(P Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_s); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_7_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -13560,7 +14231,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_ "constraint.parser.__pyx_scope_struct_7_genexpr", sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_slots, }; #else @@ -13571,12 +14242,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -13590,7 +14256,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -13625,7 +14291,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -13645,30 +14311,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_8_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_8_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_8_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_8_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_8_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr(PyObject *o) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -13679,19 +14348,24 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr(P Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_s); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_8_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_8_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_8_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_8_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -13724,7 +14398,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_ "constraint.parser.__pyx_scope_struct_8_genexpr", sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_slots, }; #else @@ -13735,12 +14409,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_8_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_8_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -13754,7 +14423,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_8_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -13789,7 +14458,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -13809,30 +14478,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_9_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_9_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_9_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_9_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_9_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_genexpr(PyObject *o) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -13841,21 +14513,26 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_genexpr(P PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_o); + Py_CLEAR(p->__pyx_v_s); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_9_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_9_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_9_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_9_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -13872,8 +14549,8 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_genexpr(P if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } - if (p->__pyx_v_o) { - e = (*v)(p->__pyx_v_o, a); if (e) return e; + if (p->__pyx_v_s) { + e = (*v)(p->__pyx_v_s, a); if (e) return e; } return 0; } @@ -13888,7 +14565,7 @@ static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr_ "constraint.parser.__pyx_scope_struct_9_genexpr", sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr_slots, }; #else @@ -13899,12 +14576,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_9_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_9_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -13918,7 +14590,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_9_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -13953,7 +14625,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -13973,30 +14645,33 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_10_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_10_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_10_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_10_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_genexpr(PyObject *o) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -14005,21 +14680,26 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_genexpr( PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_s); + Py_CLEAR(p->__pyx_v_o); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_10_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_10_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_10_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_10_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -14036,8 +14716,8 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_genexpr( if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } - if (p->__pyx_v_s) { - e = (*v)(p->__pyx_v_s, a); if (e) return e; + if (p->__pyx_v_o) { + e = (*v)(p->__pyx_v_o, a); if (e) return e; } return 0; } @@ -14048,27 +14728,189 @@ static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_10_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr_spec = { + "constraint.parser.__pyx_scope_struct_10_genexpr", + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.parser.""__pyx_scope_struct_10_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ + 0, /*tp_vectorcall_offset*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_as_async*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_genexpr, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_genexpr, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_USE_FREELISTS + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_11_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_11_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_11_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else + (void) PyObject_INIT(o, t); + #endif + PyObject_GC_Track(o); + } else + #endif + { + o = __Pyx_AllocateExtensionType(t, 1); + if (unlikely(!o)) return 0; + } + return o; +} + +static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_outer_scope); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_s); + #if CYTHON_USE_FREELISTS + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_11_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_11_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_11_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr *)o); + } else + #endif + { + PyTypeObject *tp = Py_TYPE(o); + #if CYTHON_USE_TYPE_SLOTS + (*tp->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif + } +} + +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } + if (p->__pyx_outer_scope) { + e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; + } + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_s) { + e = (*v)(p->__pyx_v_s, a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr_spec = { + "constraint.parser.__pyx_scope_struct_11_genexpr", + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_10_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_10_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_11_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -14082,9 +14924,9 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexp 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_10_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -14102,7 +14944,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexp #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_10_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -14117,7 +14959,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexp #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -14135,33 +14977,36 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_10_genexp }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint(PyObject *o) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *)o; +static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint(PyObject *o) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -14170,25 +15015,30 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_to_equal Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_params); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -14202,9 +15052,9 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_to_equal return 0; } -static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint(PyObject *o) { +static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint *)o; tmp = ((PyObject*)p->__pyx_outer_scope); p->__pyx_outer_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -14214,34 +15064,29 @@ static int __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_11_to_equality return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint}, - {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint_spec = { - "constraint.parser.__pyx_scope_struct_11_to_equality_constraint", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint_spec = { + "constraint.parser.__pyx_scope_struct_12_to_equality_constraint", + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_11_to_equality_constraint", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_12_to_equality_constraint", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -14255,10 +15100,10 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint, /*tp_traverse*/ - __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint, /*tp_clear*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint, /*tp_traverse*/ + __pyx_tp_clear_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -14275,7 +15120,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equ #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -14290,7 +15135,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equ #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -14308,33 +15153,36 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equ }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_13_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_12_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_12_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_12_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_13_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_13_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_13_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_genexpr) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -14344,25 +15192,30 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_genexpr( Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_s); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_12_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_12_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_12_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_13_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_13_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_13_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_13_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -14379,33 +15232,28 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_genexpr( return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_13_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_13_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_12_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr_spec = { + "constraint.parser.__pyx_scope_struct_13_genexpr", + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_12_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_12_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_13_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_12_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -14419,9 +15267,9 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexp 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_12_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_13_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -14439,7 +15287,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexp #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_12_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_13_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -14454,7 +15302,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexp #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -14472,33 +15320,36 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_12_genexp }; #endif -static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_13_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_13_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr)))) { - o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_13_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_13_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr)); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_14_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr)))) + { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_14_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_14_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif + memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } -static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr(PyObject *o) { - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)o; +static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_14_genexpr(PyObject *o) { + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_14_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -14507,25 +15358,30 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr( Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_r); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_13_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr)))) { - __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_13_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_13_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)o); + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_14_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr)))) + { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_14_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } -static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_13_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr *)o; + struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr *)o; { e = __Pyx_call_type_traverse(o, 1, v, a); if (e) return e; @@ -14539,33 +15395,28 @@ static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_13_genexpr( return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_13_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_13_genexpr}, +static PyType_Slot __pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_14_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_14_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_14_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr_spec = { - "constraint.parser.__pyx_scope_struct_13_genexpr", - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr), +static PyType_Spec __pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr_spec = { + "constraint.parser.__pyx_scope_struct_14_genexpr", + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr_slots, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, + __pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr = { +static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "constraint.parser.""__pyx_scope_struct_13_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_13_genexpr), /*tp_basicsize*/ + "constraint.parser.""__pyx_scope_struct_14_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_14_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_13_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 + __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_14_genexpr, /*tp_dealloc*/ 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -14579,9 +15430,9 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexp 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_13_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_14_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -14599,7 +15450,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexp #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10constraint_6parser___pyx_scope_struct_13_genexpr, /*tp_new*/ + __pyx_tp_new_10constraint_6parser___pyx_scope_struct_14_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -14614,7 +15465,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_13_genexp #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -14686,15 +15537,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions)) __PYX_ERR(0, 30, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions)) __PYX_ERR(0, 32, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions = &__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_getattro == PyObject_GenericGetAttr)) { @@ -14702,15 +15556,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)) __PYX_ERR(0, 79, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)) __PYX_ERR(0, 81, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) < (0)) __PYX_ERR(0, 81, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) < 0) __PYX_ERR(0, 79, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) < (0)) __PYX_ERR(0, 81, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_getattro == PyObject_GenericGetAttr)) { @@ -14719,14 +15576,17 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 84, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(0, 84, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(0, 84, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -14735,14 +15595,17 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 84, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(0, 84, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(0, 84, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -14751,14 +15614,17 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 95, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 95, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(0, 95, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 95, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(0, 95, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -14767,14 +15633,17 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr)) __PYX_ERR(0, 140, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 140, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr) < (0)) __PYX_ERR(0, 140, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_5_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 140, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr) < (0)) __PYX_ERR(0, 140, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -14782,15 +15651,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr)) __PYX_ERR(0, 168, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr)) __PYX_ERR(0, 160, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < (0)) __PYX_ERR(0, 160, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < (0)) __PYX_ERR(0, 160, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -14799,14 +15671,17 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr)) __PYX_ERR(0, 169, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 169, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < (0)) __PYX_ERR(0, 169, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 169, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < (0)) __PYX_ERR(0, 169, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -14814,15 +15689,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr)) __PYX_ERR(0, 172, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr)) __PYX_ERR(0, 170, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr) < (0)) __PYX_ERR(0, 170, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_8_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr) < (0)) __PYX_ERR(0, 170, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_8_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -14830,15 +15708,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr)) __PYX_ERR(0, 238, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr)) __PYX_ERR(0, 175, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr) < (0)) __PYX_ERR(0, 175, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_9_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr) < 0) __PYX_ERR(0, 238, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr) < (0)) __PYX_ERR(0, 175, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_9_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -14846,15 +15727,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr)) __PYX_ERR(0, 245, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr)) __PYX_ERR(0, 267, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr) < (0)) __PYX_ERR(0, 267, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_10_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 245, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr) < (0)) __PYX_ERR(0, 267, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_10_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -14862,53 +15746,81 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint)) __PYX_ERR(0, 269, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint) < 0) __PYX_ERR(0, 269, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr)) __PYX_ERR(0, 274, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr) < (0)) __PYX_ERR(0, 274, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_11_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint) < 0) __PYX_ERR(0, 269, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr) < (0)) __PYX_ERR(0, 274, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_to_equality_constraint->tp_getattro = PyObject_GenericGetAttr; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_11_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr)) __PYX_ERR(0, 288, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint)) __PYX_ERR(0, 298, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint) < (0)) __PYX_ERR(0, 298, __pyx_L1_error) #else - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_12_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr) < 0) __PYX_ERR(0, 288, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint) < (0)) __PYX_ERR(0, 298, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint); #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_genexpr->tp_getattro = PyObject_GenericGetAttr; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_12_to_equality_constraint->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr)) __PYX_ERR(0, 298, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr)) __PYX_ERR(0, 317, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr) < (0)) __PYX_ERR(0, 317, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_13_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(0, 298, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr) < (0)) __PYX_ERR(0, 317, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr->tp_getattro == PyObject_GenericGetAttr)) { __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_13_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr)) __PYX_ERR(0, 327, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr) < (0)) __PYX_ERR(0, 327, __pyx_L1_error) + #else + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_14_genexpr; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr) < (0)) __PYX_ERR(0, 327, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr); + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_14_genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -14950,7 +15862,7 @@ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_parser}, #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - {Py_mod_gil, Py_MOD_GIL_USED}, + {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE}, #endif #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, @@ -15012,7 +15924,8 @@ __Pyx_PyMODINIT_FUNC PyInit_parser(void) return PyModuleDef_Init(&__pyx_moduledef); } /* ModuleCreationPEP489 */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ + || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { { PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think @@ -15042,12 +15955,15 @@ static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { #if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { static PY_INT64_T main_interpreter_id = -1; -#if CYTHON_COMPILING_IN_GRAAL +#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 + PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#elif CYTHON_COMPILING_IN_GRAAL PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000 - PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API +#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ + || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#elif CYTHON_COMPILING_IN_LIMITED_API + PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); #else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); #endif @@ -15119,7 +16035,8 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_parser(PyObject *__pyx_pyinit_modu __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -15162,48 +16079,28 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_parser(PyObject *__pyx_pyinit_modu if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /* ImportRefnannyAPI */ #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - -__Pyx_RefNannySetupContext("PyInit_parser", 0); - if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } #endif + +__Pyx_RefNannySetupContext("PyInit_parser", 0); + __Pyx_init_runtime_version(); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Library function declarations ---*/ /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED) - if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ + if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error) if (__pyx_module_is_main_constraint__parser) { - if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) } { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -15212,10 +16109,10 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); } } /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(__pyx_mstate); (void)__Pyx_modinit_variable_export_code(__pyx_mstate); @@ -15226,202 +16123,170 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - /* "constraint/parser.py":2 + /* "constraint/parser.py":3 * """Module containing the code for parsing string constraints.""" + * * import re # <<<<<<<<<<<<<< * from types import FunctionType - * from typing import Union, Optional -*/ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_re, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "constraint/parser.py":3 - * """Module containing the code for parsing string constraints.""" - * import re - * from types import FunctionType # <<<<<<<<<<<<<< - * from typing import Union, Optional - * from constraint.constraints import ( + * */ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_types, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_re, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionType, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_re, __pyx_t_2) < (0)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/parser.py":4 + * * import re - * from types import FunctionType - * from typing import Union, Optional # <<<<<<<<<<<<<< + * from types import FunctionType # <<<<<<<<<<<<<< + * * from constraint.constraints import ( - * AllDifferentConstraint, */ - __pyx_t_3 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_Union, __pyx_mstate_global->__pyx_n_u_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_FunctionType}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_types, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Union, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_FunctionType}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/parser.py":6 - * from typing import Union, Optional - * from constraint.constraints import ( - * AllDifferentConstraint, # <<<<<<<<<<<<<< - * AllEqualConstraint, - * Constraint, -*/ - __pyx_t_2 = __Pyx_PyList_Pack(17, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "constraint/parser.py":5 * from types import FunctionType - * from typing import Union, Optional + * * from constraint.constraints import ( # <<<<<<<<<<<<<< * AllDifferentConstraint, * AllEqualConstraint, */ - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_AllDifferentConstraint,__pyx_mstate_global->__pyx_n_u_AllEqualConstraint,__pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint,__pyx_mstate_global->__pyx_n_u_Constraint,__pyx_mstate_global->__pyx_n_u_ExactProdConstraint,__pyx_mstate_global->__pyx_n_u_ExactSumConstraint,__pyx_mstate_global->__pyx_n_u_FunctionConstraint,__pyx_mstate_global->__pyx_n_u_MaxProdConstraint,__pyx_mstate_global->__pyx_n_u_MaxSumConstraint,__pyx_mstate_global->__pyx_n_u_MinProdConstraint,__pyx_mstate_global->__pyx_n_u_MinSumConstraint,__pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint,__pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint,__pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint,__pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint,__pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint,__pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_imported_names, 17, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_AllDifferentConstraint,__pyx_mstate_global->__pyx_n_u_AllEqualConstraint,__pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint,__pyx_mstate_global->__pyx_n_u_Constraint,__pyx_mstate_global->__pyx_n_u_ExactProdConstraint,__pyx_mstate_global->__pyx_n_u_ExactSumConstraint,__pyx_mstate_global->__pyx_n_u_FunctionConstraint,__pyx_mstate_global->__pyx_n_u_MaxProdConstraint,__pyx_mstate_global->__pyx_n_u_MaxSumConstraint,__pyx_mstate_global->__pyx_n_u_MinProdConstraint,__pyx_mstate_global->__pyx_n_u_MinSumConstraint,__pyx_mstate_global->__pyx_n_u_VariableExactProdConstraint,__pyx_mstate_global->__pyx_n_u_VariableExactSumConstraint,__pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint,__pyx_mstate_global->__pyx_n_u_VariableMaxSumConstraint,__pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint,__pyx_mstate_global->__pyx_n_u_VariableMinSumConstraint}; + for (__pyx_t_3=0; __pyx_t_3 < 17; __pyx_t_3++) { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + + /* "constraint/parser.py":32 + * + * + * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Constraint | str, list[str]]]: # <<<<<<<<<<<<<< + * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 + * # rewrite the restrictions so variables are singled out +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMinProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_restrictions, __pyx_mstate_global->__pyx_kp_u_list_str) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_tune_params, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_tuple_Constraint_str_list_s) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_1parse_restrictions, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parse_restrictions, __pyx_t_4) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/parser.py":366 + * + * + * def compile_to_constraints( # <<<<<<<<<<<<<< + * constraints: list[str], domains: dict, picklable=False + * ) -> list[tuple[Constraint, list[str], str | None]]: # noqa: E501 +*/ + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_str) < (0)) __PYX_ERR(0, 366, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 366, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_tuple_Constraint_list_str_s) < (0)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_3compile_to_constraints, 0, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VariableMaxProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[3]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, __pyx_t_2) < (0)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/parser.py":30 - * ) + /* "constraint/parser.py":404 * - * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< - * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 - * # rewrite the restrictions so variables are singled out + * + * def is_or_evals_to_number(s: str) -> int | float | None: # <<<<<<<<<<<<<< + * """Check if the string is a number or can be evaluated to a number.""" + * try: */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_restrictions, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 30, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tune_params, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 30, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_tuple_Union_Constraint_str) < 0) __PYX_ERR(0, 30, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_1parse_restrictions, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parse_restrictions, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_s, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 404, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_int_float_None) < (0)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_5is_or_evals_to_number, 0, __pyx_mstate_global->__pyx_n_u_is_or_evals_to_number, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_or_evals_to_number, __pyx_t_4) < (0)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/parser.py":336 - * return parsed_restrictions + /* "constraint/parser.py":416 * - * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< - * """Parses constraints in string format (referred to as restrictions) from a list of strings into a list of Constraints, parameters used, and source if applicable. * -*/ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) + * def extract_operators(expr: str) -> list[str]: # <<<<<<<<<<<<<< + * """Extracts all operators from an expression string.""" + * # Regex for all supported binary operators: +*/ + __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_expr, __pyx_mstate_global->__pyx_n_u_str) < (0)) __PYX_ERR(0, 416, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_str) < (0)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_7extract_operators, 0, __pyx_mstate_global->__pyx_n_u_extract_operators, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 336, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 336, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_tuple_Constraint_list_str_U) < 0) __PYX_ERR(0, 336, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_3compile_to_constraints, 0, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[3]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_extract_operators, __pyx_t_2) < (0)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 336, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/parser.py":1 * """Module containing the code for parsing string constraints.""" # <<<<<<<<<<<<<< + * * import re - * from types import FunctionType */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init constraint.parser", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -15448,252 +16313,29 @@ __Pyx_RefNannySetupContext("PyInit_parser", 0); return __pyx_m; #endif } -/* #### Code section: pystring_table ### */ - -typedef struct { - const char *s; -#if 293 <= 65535 - const unsigned short n; -#elif 293 / 2 < INT_MAX - const unsigned int n; -#elif 293 / 2 < LONG_MAX - const unsigned long n; -#else - const Py_ssize_t n; -#endif -#if 1 <= 31 - const unsigned int encoding : 5; -#elif 1 <= 255 - const unsigned char encoding; -#elif 1 <= 65535 - const unsigned short encoding; -#else - const Py_ssize_t encoding; -#endif - const unsigned int is_unicode : 1; - const unsigned int intern : 1; -} __Pyx_StringTabEntry; -static const char * const __pyx_string_tab_encodings[] = { 0 }; -static const __Pyx_StringTabEntry __pyx_string_tab[] = { - {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ - {__pyx_k_AllDifferentConstraint, sizeof(__pyx_k_AllDifferentConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllDifferentConstraint */ - {__pyx_k_AllEqualConstraint, sizeof(__pyx_k_AllEqualConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllEqualConstraint */ - {__pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AssertionError */ - {__pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CompilableFunctionConstraint */ - {__pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint */ - {__pyx_k_ExactProdConstraint, sizeof(__pyx_k_ExactProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactProdConstraint */ - {__pyx_k_ExactSumConstraint, sizeof(__pyx_k_ExactSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactSumConstraint */ - {__pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionConstraint */ - {__pyx_k_FunctionType, sizeof(__pyx_k_FunctionType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionType */ - {__pyx_k_Invalid_comparator, sizeof(__pyx_k_Invalid_comparator), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Invalid_comparator */ - {__pyx_k_Invalid_operator, sizeof(__pyx_k_Invalid_operator), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Invalid_operator */ - {__pyx_k_MaxProdConstraint, sizeof(__pyx_k_MaxProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint */ - {__pyx_k_MaxSumConstraint, sizeof(__pyx_k_MaxSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxSumConstraint */ - {__pyx_k_MinProdConstraint, sizeof(__pyx_k_MinProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinProdConstraint */ - {__pyx_k_MinSumConstraint, sizeof(__pyx_k_MinSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinSumConstraint */ - {__pyx_k_Not_possible_comparator_should_b, sizeof(__pyx_k_Not_possible_comparator_should_b), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Not_possible_comparator_should_b */ - {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ - {__pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Optional */ - {__pyx_k_Optional_Union_AllEqualConstrain, sizeof(__pyx_k_Optional_Union_AllEqualConstrain), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Optional_Union_AllEqualConstrain */ - {__pyx_k_Optional_Union_MinSumConstraint, sizeof(__pyx_k_Optional_Union_MinSumConstraint), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Optional_Union_MinSumConstraint */ - {__pyx_k_Optional_Union_int_float, sizeof(__pyx_k_Optional_Union_int_float), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Optional_Union_int_float */ - {__pyx_k_Restriction, sizeof(__pyx_k_Restriction), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Restriction */ - {__pyx_k_Union, sizeof(__pyx_k_Union), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Union */ - {__pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ValueError */ - {__pyx_k_VariableExactProdConstraint, sizeof(__pyx_k_VariableExactProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactProdConstraint */ - {__pyx_k_VariableExactSumConstraint, sizeof(__pyx_k_VariableExactSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableExactSumConstraint */ - {__pyx_k_VariableMaxProdConstraint, sizeof(__pyx_k_VariableMaxProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxProdConstraint */ - {__pyx_k_VariableMaxSumConstraint, sizeof(__pyx_k_VariableMaxSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMaxSumConstraint */ - {__pyx_k_VariableMinProdConstraint, sizeof(__pyx_k_VariableMinProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinProdConstraint */ - {__pyx_k_VariableMinSumConstraint, sizeof(__pyx_k_VariableMinSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VariableMinSumConstraint */ - {__pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__10 */ - {__pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__11 */ - {__pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__12 */ - {__pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__13 */ - {__pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__14 */ - {__pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__15 */ - {__pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__16 */ - {__pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__17 */ - {__pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__18 */ - {__pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__19 */ - {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ - {__pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__20 */ - {__pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__21 */ - {__pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__22 */ - {__pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__23 */ - {__pyx_k__24, sizeof(__pyx_k__24), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__24 */ - {__pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__3 */ - {__pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__4 */ - {__pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__5 */ - {__pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__6 */ - {__pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__7 */ - {__pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__8 */ - {__pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__9 */ - {__pyx_k_a_zA_Z__0_9, sizeof(__pyx_k_a_zA_Z__0_9), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_a_zA_Z__0_9 */ - {__pyx_k_a_zA_Z__a_zA_Z__0_9, sizeof(__pyx_k_a_zA_Z__a_zA_Z__0_9), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 */ - {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ - {__pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_and */ - {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */ - {__pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class_getitem */ - {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ - {__pyx_k_close, sizeof(__pyx_k_close), 0, 1, 1}, /* PyObject cname: __pyx_n_u_close */ - {__pyx_k_co_consts, sizeof(__pyx_k_co_consts), 0, 1, 1}, /* PyObject cname: __pyx_n_u_co_consts */ - {__pyx_k_code_object, sizeof(__pyx_k_code_object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_code_object */ - {__pyx_k_comparator, sizeof(__pyx_k_comparator), 0, 1, 1}, /* PyObject cname: __pyx_n_u_comparator */ - {__pyx_k_comparators, sizeof(__pyx_k_comparators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_comparators */ - {__pyx_k_comparators_found, sizeof(__pyx_k_comparators_found), 0, 1, 1}, /* PyObject cname: __pyx_n_u_comparators_found */ - {__pyx_k_comparators_indices, sizeof(__pyx_k_comparators_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_comparators_indices */ - {__pyx_k_compile, sizeof(__pyx_k_compile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compile */ - {__pyx_k_compile_to_constraints, sizeof(__pyx_k_compile_to_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compile_to_constraints */ - {__pyx_k_compiled_constraints, sizeof(__pyx_k_compiled_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compiled_constraints */ - {__pyx_k_constraint, sizeof(__pyx_k_constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint */ - {__pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_constraints */ - {__pyx_k_constraint_parser, sizeof(__pyx_k_constraint_parser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_parser */ - {__pyx_k_constraint_parser_py, sizeof(__pyx_k_constraint_parser_py), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_constraint_parser_py */ - {__pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraints */ - {__pyx_k_def_r, sizeof(__pyx_k_def_r), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_def_r */ - {__pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict */ - {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */ - {__pyx_k_domains, sizeof(__pyx_k_domains), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domains */ - {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */ - {__pyx_k_end, sizeof(__pyx_k_end), 0, 1, 1}, /* PyObject cname: __pyx_n_u_end */ - {__pyx_k_equalities_found, sizeof(__pyx_k_equalities_found), 0, 1, 1}, /* PyObject cname: __pyx_n_u_equalities_found */ - {__pyx_k_eval, sizeof(__pyx_k_eval), 0, 1, 1}, /* PyObject cname: __pyx_n_u_eval */ - {__pyx_k_exec, sizeof(__pyx_k_exec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exec */ - {__pyx_k_finalized_constraint, sizeof(__pyx_k_finalized_constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_finalized_constraint */ - {__pyx_k_findall, sizeof(__pyx_k_findall), 0, 1, 1}, /* PyObject cname: __pyx_n_u_findall */ - {__pyx_k_finditer, sizeof(__pyx_k_finditer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_finditer */ - {__pyx_k_fromkeys, sizeof(__pyx_k_fromkeys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fromkeys */ - {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */ - {__pyx_k_func_2, sizeof(__pyx_k_func_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_2 */ - {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */ - {__pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_genexpr */ - {__pyx_k_group, sizeof(__pyx_k_group), 0, 1, 1}, /* PyObject cname: __pyx_n_u_group */ - {__pyx_k_i, sizeof(__pyx_k_i), 0, 1, 1}, /* PyObject cname: __pyx_n_u_i */ - {__pyx_k_index, sizeof(__pyx_k_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_index */ - {__pyx_k_inequalities_found, sizeof(__pyx_k_inequalities_found), 0, 1, 1}, /* PyObject cname: __pyx_n_u_inequalities_found */ - {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */ - {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */ - {__pyx_k_is_neither_a_string_or_Constrai, sizeof(__pyx_k_is_neither_a_string_or_Constrai), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_is_neither_a_string_or_Constrai */ - {__pyx_k_is_or_evals_to_number, sizeof(__pyx_k_is_or_evals_to_number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_or_evals_to_number */ - {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */ - {__pyx_k_key, sizeof(__pyx_k_key), 0, 1, 1}, /* PyObject cname: __pyx_n_u_key */ - {__pyx_k_left, sizeof(__pyx_k_left), 0, 1, 1}, /* PyObject cname: __pyx_n_u_left */ - {__pyx_k_left_num, sizeof(__pyx_k_left_num), 0, 1, 1}, /* PyObject cname: __pyx_n_u_left_num */ - {__pyx_k_left_remainder, sizeof(__pyx_k_left_remainder), 0, 1, 1}, /* PyObject cname: __pyx_n_u_left_remainder */ - {__pyx_k_left_swap, sizeof(__pyx_k_left_swap), 0, 1, 1}, /* PyObject cname: __pyx_n_u_left_swap */ - {__pyx_k_list_str, sizeof(__pyx_k_list_str), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_str */ - {__pyx_k_list_tuple_Constraint_list_str_U, sizeof(__pyx_k_list_tuple_Constraint_list_str_U), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_tuple_Constraint_list_str_U */ - {__pyx_k_list_tuple_Union_Constraint_str, sizeof(__pyx_k_list_tuple_Union_Constraint_str), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_tuple_Union_Constraint_str */ - {__pyx_k_m, sizeof(__pyx_k_m), 0, 1, 1}, /* PyObject cname: __pyx_n_u_m */ - {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ - {__pyx_k_match_object, sizeof(__pyx_k_match_object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_match_object */ - {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ - {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ - {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */ - {__pyx_k_next_stop, sizeof(__pyx_k_next_stop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next_stop */ - {__pyx_k_number, sizeof(__pyx_k_number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_number */ - {__pyx_k_o, sizeof(__pyx_k_o), 0, 1, 1}, /* PyObject cname: __pyx_n_u_o */ - {__pyx_k_offset, sizeof(__pyx_k_offset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_offset */ - {__pyx_k_operator, sizeof(__pyx_k_operator), 0, 1, 1}, /* PyObject cname: __pyx_n_u_operator */ - {__pyx_k_operators, sizeof(__pyx_k_operators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_operators */ - {__pyx_k_operators_found, sizeof(__pyx_k_operators_found), 0, 1, 1}, /* PyObject cname: __pyx_n_u_operators_found */ - {__pyx_k_operators_left, sizeof(__pyx_k_operators_left), 0, 1, 1}, /* PyObject cname: __pyx_n_u_operators_left */ - {__pyx_k_operators_right, sizeof(__pyx_k_operators_right), 0, 1, 1}, /* PyObject cname: __pyx_n_u_operators_right */ - {__pyx_k_or, sizeof(__pyx_k_or), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_or */ - {__pyx_k_p, sizeof(__pyx_k_p), 0, 1, 1}, /* PyObject cname: __pyx_n_u_p */ - {__pyx_k_param, sizeof(__pyx_k_param), 0, 1, 1}, /* PyObject cname: __pyx_n_u_param */ - {__pyx_k_params, sizeof(__pyx_k_params), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params */ - {__pyx_k_params_params_index, sizeof(__pyx_k_params_params_index), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_params_params_index */ - {__pyx_k_params_used, sizeof(__pyx_k_params_used), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_used */ - {__pyx_k_params_used_list, sizeof(__pyx_k_params_used_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_used_list */ - {__pyx_k_parse_restrictions, sizeof(__pyx_k_parse_restrictions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions */ - {__pyx_k_parse_restrictions_locals_genexp, sizeof(__pyx_k_parse_restrictions_locals_genexp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_genexp */ - {__pyx_k_parse_restrictions_locals_replac, sizeof(__pyx_k_parse_restrictions_locals_replac), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_replac */ - {__pyx_k_parse_restrictions_locals_replac_2, sizeof(__pyx_k_parse_restrictions_locals_replac_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_replac_2 */ - {__pyx_k_parse_restrictions_locals_to_equ, sizeof(__pyx_k_parse_restrictions_locals_to_equ), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_to_equ */ - {__pyx_k_parse_restrictions_locals_to_equ_2, sizeof(__pyx_k_parse_restrictions_locals_to_equ_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_to_equ_2 */ - {__pyx_k_parse_restrictions_locals_to_mul, sizeof(__pyx_k_parse_restrictions_locals_to_mul), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_to_mul */ - {__pyx_k_parse_restrictions_locals_to_num, sizeof(__pyx_k_parse_restrictions_locals_to_num), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_to_num */ - {__pyx_k_parse_restrictions_locals_to_num_2, sizeof(__pyx_k_parse_restrictions_locals_to_num_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_to_num_2 */ - {__pyx_k_parse_restrictions_locals_to_num_3, sizeof(__pyx_k_parse_restrictions_locals_to_num_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_to_num_3 */ - {__pyx_k_parse_restrictions_locals_to_num_4, sizeof(__pyx_k_parse_restrictions_locals_to_num_4), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_to_num_4 */ - {__pyx_k_parsed_restriction, sizeof(__pyx_k_parsed_restriction), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parsed_restriction */ - {__pyx_k_parsed_restrictions, sizeof(__pyx_k_parsed_restrictions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parsed_restrictions */ - {__pyx_k_picklable, sizeof(__pyx_k_picklable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_picklable */ - {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ - {__pyx_k_prev_stop, sizeof(__pyx_k_prev_stop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prev_stop */ - {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ - {__pyx_k_r, sizeof(__pyx_k_r), 0, 1, 1}, /* PyObject cname: __pyx_n_u_r */ - {__pyx_k_range, sizeof(__pyx_k_range), 0, 1, 1}, /* PyObject cname: __pyx_n_u_range */ - {__pyx_k_re, sizeof(__pyx_k_re), 0, 1, 1}, /* PyObject cname: __pyx_n_u_re */ - {__pyx_k_regex_match_variable, sizeof(__pyx_k_regex_match_variable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_regex_match_variable */ - {__pyx_k_regex_match_variable_or_constant, sizeof(__pyx_k_regex_match_variable_or_constant), 0, 1, 1}, /* PyObject cname: __pyx_n_u_regex_match_variable_or_constant */ - {__pyx_k_replace, sizeof(__pyx_k_replace), 0, 1, 1}, /* PyObject cname: __pyx_n_u_replace */ - {__pyx_k_replace_params, sizeof(__pyx_k_replace_params), 0, 1, 1}, /* PyObject cname: __pyx_n_u_replace_params */ - {__pyx_k_replace_params_split, sizeof(__pyx_k_replace_params_split), 0, 1, 1}, /* PyObject cname: __pyx_n_u_replace_params_split */ - {__pyx_k_res, sizeof(__pyx_k_res), 0, 1, 1}, /* PyObject cname: __pyx_n_u_res */ - {__pyx_k_restriction, sizeof(__pyx_k_restriction), 0, 1, 1}, /* PyObject cname: __pyx_n_u_restriction */ - {__pyx_k_restrictions, sizeof(__pyx_k_restrictions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_restrictions */ - {__pyx_k_restrictions_cleaned, sizeof(__pyx_k_restrictions_cleaned), 0, 1, 1}, /* PyObject cname: __pyx_n_u_restrictions_cleaned */ - {__pyx_k_restrictions_cleaned_unique, sizeof(__pyx_k_restrictions_cleaned_unique), 0, 1, 1}, /* PyObject cname: __pyx_n_u_restrictions_cleaned_unique */ - {__pyx_k_restrictions_unique_indices, sizeof(__pyx_k_restrictions_unique_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_restrictions_unique_indices */ - {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */ - {__pyx_k_return_2, sizeof(__pyx_k_return_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_return_2 */ - {__pyx_k_right, sizeof(__pyx_k_right), 0, 1, 1}, /* PyObject cname: __pyx_n_u_right */ - {__pyx_k_right_num, sizeof(__pyx_k_right_num), 0, 1, 1}, /* PyObject cname: __pyx_n_u_right_num */ - {__pyx_k_right_remainder, sizeof(__pyx_k_right_remainder), 0, 1, 1}, /* PyObject cname: __pyx_n_u_right_remainder */ - {__pyx_k_right_swap, sizeof(__pyx_k_right_swap), 0, 1, 1}, /* PyObject cname: __pyx_n_u_right_swap */ - {__pyx_k_s, sizeof(__pyx_k_s), 0, 1, 1}, /* PyObject cname: __pyx_n_u_s */ - {__pyx_k_search, sizeof(__pyx_k_search), 0, 1, 1}, /* PyObject cname: __pyx_n_u_search */ - {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */ - {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */ - {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */ - {__pyx_k_split, sizeof(__pyx_k_split), 0, 1, 1}, /* PyObject cname: __pyx_n_u_split */ - {__pyx_k_split_restrictions, sizeof(__pyx_k_split_restrictions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_split_restrictions */ - {__pyx_k_splitted, sizeof(__pyx_k_splitted), 0, 1, 1}, /* PyObject cname: __pyx_n_u_splitted */ - {__pyx_k_start, sizeof(__pyx_k_start), 0, 1, 1}, /* PyObject cname: __pyx_n_u_start */ - {__pyx_k_str, sizeof(__pyx_k_str), 0, 1, 1}, /* PyObject cname: __pyx_n_u_str */ - {__pyx_k_string, sizeof(__pyx_k_string), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_string */ - {__pyx_k_strip, sizeof(__pyx_k_strip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_strip */ - {__pyx_k_sub, sizeof(__pyx_k_sub), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sub */ - {__pyx_k_supported_operators, sizeof(__pyx_k_supported_operators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_supported_operators */ - {__pyx_k_swapped_side_first_component, sizeof(__pyx_k_swapped_side_first_component), 0, 1, 1}, /* PyObject cname: __pyx_n_u_swapped_side_first_component */ - {__pyx_k_temp_copy, sizeof(__pyx_k_temp_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_temp_copy */ - {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ - {__pyx_k_throw, sizeof(__pyx_k_throw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_throw */ - {__pyx_k_to_equality_constraint, sizeof(__pyx_k_to_equality_constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_equality_constraint */ - {__pyx_k_to_multiple_restrictions, sizeof(__pyx_k_to_multiple_restrictions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_multiple_restrictions */ - {__pyx_k_to_numeric_constraint, sizeof(__pyx_k_to_numeric_constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_numeric_constraint */ - {__pyx_k_tune_params, sizeof(__pyx_k_tune_params), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tune_params */ - {__pyx_k_types, sizeof(__pyx_k_types), 0, 1, 1}, /* PyObject cname: __pyx_n_u_types */ - {__pyx_k_typing, sizeof(__pyx_k_typing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_typing */ - {__pyx_k_union, sizeof(__pyx_k_union), 0, 1, 1}, /* PyObject cname: __pyx_n_u_union */ - {__pyx_k_unique_operators, sizeof(__pyx_k_unique_operators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unique_operators */ - {__pyx_k_unique_operators_left, sizeof(__pyx_k_unique_operators_left), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unique_operators_left */ - {__pyx_k_unique_operators_right, sizeof(__pyx_k_unique_operators_right), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unique_operators_right */ - {__pyx_k_v, sizeof(__pyx_k_v), 0, 1, 1}, /* PyObject cname: __pyx_n_u_v */ - {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ - {__pyx_k_variable_operators_left, sizeof(__pyx_k_variable_operators_left), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_operators_left */ - {__pyx_k_variable_operators_right, sizeof(__pyx_k_variable_operators_right), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_operators_right */ - {__pyx_k_variable_supported_operators, sizeof(__pyx_k_variable_supported_operators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_supported_operators */ - {__pyx_k_variable_unique_operators, sizeof(__pyx_k_variable_unique_operators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_unique_operators */ - {__pyx_k_variables, sizeof(__pyx_k_variables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables */ - {__pyx_k_variables_on_left, sizeof(__pyx_k_variables_on_left), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables_on_left */ - {0, 0, 0, 0, 0} -}; -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); - +/* #### Code section: pystring_table ### */ /* #### Code section: cached_builtins ### */ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 70, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 234, __pyx_L1_error) - __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 151, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 152, __pyx_L1_error) - __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 408, __pyx_L1_error) + + /* Cached unbound methods */ + __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items; + __pyx_mstate->__pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_keys.method_name = &__pyx_mstate->__pyx_n_u_keys; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; + __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values; + __pyx_mstate->__pyx_umethod_PyList_Type__index.type = (PyObject*)(&PyList_Type); + __pyx_mstate->__pyx_umethod_PyList_Type__index.method_name = &__pyx_mstate->__pyx_n_u_index; + __pyx_mstate->__pyx_umethod_PySet_Type__union.type = (PyObject*)(&PySet_Type); + __pyx_mstate->__pyx_umethod_PySet_Type__union.method_name = &__pyx_mstate->__pyx_n_u_union; + __pyx_mstate->__pyx_umethod_PyUnicode_Type__strip.type = (PyObject*)(&PyUnicode_Type); + __pyx_mstate->__pyx_umethod_PyUnicode_Type__strip.method_name = &__pyx_mstate->__pyx_n_u_strip; return 0; __pyx_L1_error:; return -1; @@ -15707,83 +16349,137 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { /* "constraint/parser.py":120 * # e.g. "G == B-M" becomes "G+M == B" - * right_remainder = right[len(swapped_side_first_component):] + * right_remainder = right[len(swapped_side_first_component) :] * left_swap = right_remainder.replace("-", "+") # <<<<<<<<<<<<<< * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" * else: */ - __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__11, __pyx_mstate_global->__pyx_kp_u__10); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__8, __pyx_mstate_global->__pyx_kp_u__9); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); /* "constraint/parser.py":131 * # e.g. "G == B/M" becomes "G*M == B" - * right_remainder = right[len(swapped_side_first_component):] + * right_remainder = right[len(swapped_side_first_component) :] * left_swap = right_remainder.replace("/", "*") # <<<<<<<<<<<<<< * restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" * else: */ - __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__12, __pyx_mstate_global->__pyx_kp_u__9); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__10, __pyx_mstate_global->__pyx_kp_u__11); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - /* "constraint/parser.py":176 - * if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": + /* "constraint/parser.py":182 * if comparator == "==": - * return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 # <<<<<<<<<<<<<< - * elif comparator == "<=": - * # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) + * return ( + * VariableExactSumConstraint(variables[-1], variables[:-1]) # <<<<<<<<<<<<<< + * if variables_on_left + * else VariableExactSumConstraint(variables[0], variables[1:]) */ - __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, __pyx_mstate_global->__pyx_int_neg_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, __pyx_mstate_global->__pyx_int_neg_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - __pyx_mstate_global->__pyx_slice[1] = PySlice_New(__pyx_mstate_global->__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[1])) __PYX_ERR(0, 176, __pyx_L1_error) + + /* "constraint/parser.py":184 + * VariableExactSumConstraint(variables[-1], variables[:-1]) + * if variables_on_left + * else VariableExactSumConstraint(variables[0], variables[1:]) # <<<<<<<<<<<<<< + * ) # noqa: E501 + * elif comparator == "<=": +*/ + __pyx_mstate_global->__pyx_slice[1] = PySlice_New(__pyx_mstate_global->__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[1])) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]); - /* "constraint/parser.py":300 + /* "constraint/parser.py":329 * if all(isinstance(r, str) for r in restrictions): * # clean the restriction strings to functional equivalence - * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] # <<<<<<<<<<<<<< - * restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order + * restrictions_cleaned = [r.replace(" ", "") for r in restrictions] # <<<<<<<<<<<<<< + * restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order * # get the indices of the unique restrictions, use these to build a new list of restrictions */ - __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__17, __pyx_mstate_global->__pyx_kp_u__18); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__17, __pyx_mstate_global->__pyx_kp_u__18); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - /* "constraint/parser.py":321 + /* "constraint/parser.py":350 * and parsed_restriction[-1] == ")" * and "(" not in parsed_restriction[1:] * and ")" not in parsed_restriction[:1] # <<<<<<<<<<<<<< * ): * parsed_restriction = parsed_restriction[1:-1] */ - __pyx_mstate_global->__pyx_slice[2] = PySlice_New(Py_None, __pyx_mstate_global->__pyx_int_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[2])) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_mstate_global->__pyx_slice[2] = PySlice_New(Py_None, __pyx_mstate_global->__pyx_int_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[2])) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]); - /* "constraint/parser.py":323 + /* "constraint/parser.py":352 * and ")" not in parsed_restriction[:1] * ): * parsed_restriction = parsed_restriction[1:-1] # <<<<<<<<<<<<<< * # check if we can turn this into the built-in numeric comparison constraint * finalized_constraint = to_numeric_constraint(parsed_restriction, params_used_list) */ - __pyx_mstate_global->__pyx_slice[3] = PySlice_New(__pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_neg_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[3])) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_mstate_global->__pyx_slice[3] = PySlice_New(__pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_neg_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[3])) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]); - /* "constraint/parser.py":336 - * return parsed_restrictions + /* "constraint/parser.py":366 * - * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< - * """Parses constraints in string format (referred to as restrictions) from a list of strings into a list of Constraints, parameters used, and source if applicable. * + * def compile_to_constraints( # <<<<<<<<<<<<<< + * constraints: list[str], domains: dict, picklable=False + * ) -> list[tuple[Constraint, list[str], str | None]]: # noqa: E501 */ - __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_tuple; + for (Py_ssize_t i=0; i<4; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_slice; + for (Py_ssize_t i=0; i<4; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -15794,38 +16490,141 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; - __pyx_mstate->__pyx_umethod_PyList_Type__index.type = (PyObject*)(&PyList_Type); - __pyx_mstate->__pyx_umethod_PyList_Type__index.method_name = &__pyx_mstate->__pyx_n_u_index; - __pyx_mstate->__pyx_umethod_PySet_Type__union.type = (PyObject*)(&PySet_Type); - __pyx_mstate->__pyx_umethod_PySet_Type__union.method_name = &__pyx_mstate->__pyx_n_u_union; - if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_neg_1 = PyLong_FromLong(-1); if (unlikely(!__pyx_mstate->__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + { + const struct { const unsigned int length: 11; } index[] = {{3},{50},{19},{17},{294},{52},{179},{12},{10},{1},{1},{4},{2},{2},{2},{2},{1},{0},{1},{2},{1},{2},{2},{1},{1},{2},{1},{1},{1},{2},{1},{1},{16},{26},{8},{5},{20},{8},{6},{7},{6},{2},{18},{35},{9},{9},{46},{40},{176},{20},{4},{21},{10},{8},{22},{18},{28},{10},{19},{18},{18},{12},{17},{16},{17},{16},{20},{7},{27},{26},{25},{24},{25},{24},{12},{18},{17},{18},{5},{9},{11},{10},{11},{17},{19},{7},{22},{20},{10},{22},{17},{11},{4},{7},{3},{16},{4},{4},{4},{17},{20},{7},{8},{8},{8},{4},{7},{5},{1},{5},{18},{13},{21},{5},{3},{4},{4},{8},{14},{9},{1},{8},{12},{7},{10},{8},{4},{9},{6},{1},{6},{8},{9},{15},{14},{15},{1},{5},{6},{11},{16},{18},{35},{42},{48},{67},{50},{52},{83},{66},{49},{18},{19},{7},{9},{3},{9},{12},{1},{2},{20},{32},{7},{14},{20},{3},{11},{12},{20},{27},{27},{6},{5},{9},{15},{10},{1},{6},{4},{12},{10},{5},{18},{8},{5},{3},{5},{3},{28},{9},{8},{5},{22},{24},{21},{11},{5},{5},{16},{21},{22},{1},{5},{6},{3},{23},{24},{28},{25},{9},{17},{2},{2},{223},{50},{50},{69},{2},{2},{251},{176},{45},{392},{2},{2},{2},{2},{1757},{2},{2}}; + #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (3177 bytes) */ +const char* const cstring = "(\265/\375`a\030\375b\000Z\201\334\033;\360\0327\314\300l\000\2222\3101\342\246\001+\244\220\224A>anJ|\310\265\373\336\254\321\n\321:\235\"e\202$\304EH\022@\t\000\000\001@\021\202K\002QfRT\021B\004\250\001\237\001\266\001%\337)\312\266\352\252\232%*j\246B\276s\214\206l\212r\222x\273\210\rn\241\022'($*\313\237\360(muz\350\r\215\314\230\256-\273\327\021\246F\313\005\367\231\242en\344\276r\247\255\3118\0222\216\210\214:\223\020'\221\\\215\253=\323\304\327\246&\253\256\032\205\373\334\277\021\206d\024\256:Ew$N5\335\351T\263r\312\315\204\260j:\262!!\243\224\311j\337\310\221U\013q\"ej@F\004\235N72\216\344v\357\327\262\272\034\313\321\336\251\307\025\335\251V{<3*\335\034=A\326\221\267O\221\323\251FG\"\222\023\376J\326\315M\314\264\314\003\373M\177\350W8\177\363\274\036\343\316\312\247\377\244\373\272\237\277#o\3106'\037\370\336x@|\010\330\\\204\373+q(\346\2231\2075\334\001\013\300F/\312+B\361\003\272\221{s\t\334\225a\002\254\250\337\202\027\350\203\275\250c\300\346\333\313\3638\277\324Q\372\205\315}\210\315\272\343:G\347np\250\207)\303\330\001@A\027\302""\301L\372\r\210\371\306e\203m>U\313U\375\375Z\316w[\225\266V\352*\305\226\245\360\367\363\245;UK\224W\356\023\345\277]\313\177\354znV\363\366\311n^\226R\346\2527\347\273\005\242i[\236;\325\233MuUpG\355u\257kYV\375\324\037\225\211\376R\366\334\275\037\312\366Z\237\360\307KS\367~{-\2411\325\236L\t_\313\362\334\274-\371\217\225\212BWvs\036OU\177*\273}:mO\325\367\323V|\325\276\275\262\274\335\343\274\\\325\222\243e\212\242\277\250tG\361\204\233\312\247\256\274\265\327\323\347U\212\362x0\270\315\035\334{\243,\272\317ts\237z\262%%'[\356m\242g\332\252\274\222\357\324r\237\252\311K\325\334T\246\336m\263\364m\026ewTY\006\237\326p\343;\030>\216\030\364\362\003b\027\216\317\021\017\304@\270\005v a\031l\323\370\006\035\307\325o\312\316\177\314\376\254\301\364)\n\261b\000,q\324g\235\346\266\314*\335\0026\347\210>\021\314\207\351\3706\317\0013\320=\203\240x\233\311\340\234\227\3405\212A\020\217d\016Y&\263\3041\264\257\213\2628 \026\276*/\371\236\376#na\025\230}=&\200]\303\215x\001\260\200t$\267`]\210a\360\312\353\353\032/\000\224\256\014\277\361\002\230\0014t\021\314\266~\241e\246x\306\343{\000\374b,a\016xW|\255\313f\256\014V|\021\0241v\372k\250\017\225\373\271\221o{\237\372\255\207\270\016\262\017\306P\220P\230IY\007_\274\2537\360#N\216\212;\256\336\037o\363Yn,\003\373\242zF\203,~\301\370\030\336\347\342\\\230\233/]\205!\214`\006\022\207b\335{{G*\276\305\013 \242\253\3405{\310\346\000M, N\305>\260\r\256IE}\363\233N\337\251\3517\345\374\233\374 \257qD\314\002\223;\332lV\"\242\020\223\344\227\274\213Sb2\026\210wp\001\014|M.\376\255_x\322\363\256;D?p\033\212 \017\177\216\342}\336\322_R\372JE\237\0235\221IF\221w\334\021\2370\016\236\301\0010\316k{\2236\374\306\333\372\010\317\322\311^\021+\312\032d/\315o4\314\266w\340\225\360f\357`\330\031\306\310x\3535!\3708\027\007\003\273G?\335\0247ix\033\332\206\t\0043\371\n\274\037\236\242\007t\230\273C\350\322C\206W\300\016\3648\362\027\241\312/\364\205Z\376O\221d\350\017\271\374\\l\3021+\020\263\207\n\331,|\251\261\301$\214\202\361}\276O\312O""\300j1\034`v=\245\2730\304$\360\003\223{s!\006\372\204\302Lv\013Y7\335\030\327a\237\377L\3721\304\004Y\">\200\247|\207\327\351\255\3334\264\365\004W6S\240\270\311/\2619CW^\210\254|\213e\204\262\212\354\200\343\020\007D\034\331&\327pD\337\210\330#\0230\3017X\205\242F\356\275\230r#\314\006\216/\320'bEs\367w\270\177D|\021%\344\203\030\007\346U\274zj0X\227M\007V\321\370\032\261\000\2177\343g\274\372-\211\315\036\035\304}PPJ\372U12)\333x\374\014O\316p/\307\021I\005\2034{\005_\006?\316n\266\212\373\300\262\020\177L\276Iq\244\210\203\371 0\n\254\024\243\3041\003@X\237X\374\007O\332\3042\"\237T\361\016~\355\032s\305\257\010\241\370\025\336\245oWj\310\000\3648\317\3417\030\276\216\027<^\356\265\227\3526\375\342\205xY|R\257r\265\033\001#_\254\215\231W\204\340\2231\351I\230|7|\313\221\321g\3718\370\345\342\375\200\037\023\276Q\321/\242\371\270x\206\026\202\201\250\022\273\214\005\235S$2\"\222$)\244\003\"\030\014\022\r\306i\252l\037\222\332\030U\006)c\220\210\210\210\210\004\"\222\202\224QPHkx89\330\200\013\265@\331\350OHb,\023*\017\240O\313\342\\N\214B\331-\004P4\242X\\\223u2\276[\202\337\253\010\001'Q\223T\267E\016\377U\220x\256[9\254\277\227|l\000\035t\242Q\250\250\267q\247G\221\253w\016\271\225\200\310\365\351\016\201\236y\346\254\261.\322\230\372\021\016E\270\214\376\t\002\026\321\263\260wF\272+v>\354\306h\000\311\230\374\2769\314\374\204\215\316hkxj`\001\237\243\225mS\205XL.R[S{[\337A\327\345\316\024\277\253\344 i\332\022\323\030\253G\342\320u\347\203\276\010\3405{\223Bs\332L\006r\2310[\247\035\362\311${;\3133\334\300G[\303\362\366w\346\2169\324\224\305gL*O\350\246;,\363,\216B\230\335No\333\274p\376J\273\376r@7\0021\202\020\0179<\210\361;\"\330\317P\227.\315\307O\304\210!9\307|1\376\303\372\"\332B9\037\355\331a\340J~""Uf\206oP\253\321\312\315\035}F\337\303\304\262&\362\266Xm\256\276\262\343B\247/\233\207H9]\300\r\340I\325\366\232\340\330r{\247I\250T'{\236\201\205$\315\263\200\246\374\033xTv\021\350\005\354\274w~h\237:+\250\310u\227\022^0\217\200<\317q\373\002L\006\357\331\032\215\234\247\314&^\314\374\323A\313\037\002\321^FH\004\371\227\320\346B\334#r_\357\321K\303\216\355\236\252\201\342#Z\275\253\211x0\013\216\021?\246T4:\366\346\366\202 \371<\304\272~\036\022\311]\233\324\247\335\021\245/\007\347\251\034sd\034\025\347\217\220\021\217\"w\377(V\264\347\255\311\036se\210\333\340\232+<\200\021\354\213%\201_?l\203\024,`\007{\n\262D\022p\005\023h\327\304PW@\234\243J3\371UR(\214\r\030\323\357s\255\024\234\247\275\252g\223\r\2711/(\306\3049\005\0007O\267\365\026\364z0M\005\243\202JP\346\351\304\323\214l\211\230\271\277\230\274\372\324e\000P\340\200A\002\333\255u.\315R!P\004\334\207td\326\"v\244\337\3476\017<\264\327>\033\313H\302l\023|\271\013,\304\220\020\261\001\020\337\3032\2247\251\345\254\237\372\254\2062.\264\310K\000\212S\270\362\351\366\226\005|(\307\245`\\\205,\023YC\n\352:\223x+fI\022&7\373\223\200\200r*>+:w\251\321\215\220\006\373\302\325L\001\247@~\016\025\256{o\017j\3460}Z\" \234\243\233\304\202\361d\260\037\355\242#$\343\212\323z\037R\337\244\314\345h^\254\027\275\244Dii\357\340\351kz\337k=\240|\303\002\345\023\244\003\261\320C\007\222\034\021\201\rc\274vTh\325\221M\341\014\006\032\271\305\344MK\007I\207\236\330%\005\205\361\263\017R2\257\256\r\255V\201\177\345\227\352\007\364u\315\034$\345-\352~\236\351_\177\025\367\325\1773\336t\300d\242\351\234\201\221(\274\311>7\034\236\230\023\232\276\022\245H4\234Ku\037\200\2160\317\n\260&\270\263\332}\302\314|H\341\236\005F\232l\016\223a\223\356\224*S\257T\232X^@K\2534\210\257VH\256\333\241\222L\351\260\272\035\r\n\003\311\001\201s_(i\331\363\204yn\333\302nJ]Lj\221\222\245Xv\005\365\232\224=\205E\364\257x\263\331\303\202T\220D\314\374\322\342\231\364.\307\021LM\0009\316\257\237u\356[z\242Bd\033\215^\3471K\213\344\311""\201\355\271/\321\260\244\0035\314\037\363\271\241\3411K\246vw@\360pp\316\264\211\321\357=\\ Qg\005\244jy\327\024\275D\320TG\371\241\340\2416\324\235_\322\366e\017\203f\337M\031!\347}\374\374[\023\353O\245\340\017\0065hF\377\364\276\004\0327\253\337\"\2503\337\177\220\026f;\241\244+\327\202\347L\002\220\211\034#\016\031\036HkO\203\\\nB\010\026T\206\273\326\250\201\344\342vgv\00519\0138\010\224w\312\n)\203A\236\371\310\021\001\021^\217q\002\377\216\262^\"\276(\305U\271\376\276\231=\346^\020\022\036\301\024\006\025\253\320\007L\020m\023ze \237w\246\361RH\207\014\202\241\010\010\007\303\322\315\257v\2462\221\355F\n,\374\261q\372\252\267\237/kb\246\364\305&zH\326\357\264\236\340b\242,2t\306\020\006P\277\266#\374<\020\336\312\304\342\225\330\350M\257*w~bA\033\247\035)S\034\267zXN\311[\215\242\246\204C@\272\2429\223\332E\236\005\245\016\373%\\\2608\372^\202\t\252\212T\330\277MA\323Ft\232-\372d\363~\316\355\375z\243\251a\234lMZ\375\272\217Q\007\377\220v\225b\376\362\326OI\331}qf\337\234\034\334\250\346\222\263\177O\276{\372\335i\345\034\234\372\340\255\033\016"; + PyObject *data = __Pyx_DecompressString(cstring, 3177, 3); + if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) + const char* const bytes = __Pyx_PyBytes_AsString(data); + #if !CYTHON_ASSUME_SAFE_MACROS + if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } + #endif + #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (3256 bytes) */ +const char* const cstring = "BZh91AY&SY\002\303\215g\000\002\016\177\377\377\377\377\377\377\377\377\377\277\377\377\377\377\377\377\377@@@@@@@@@@@@@\000@\000`\014<\371S\267\275w\274\317x\336R\256\307\216\266\236\316+\212\333%\335\335d\360\000\003\233\301(D\204\032\024?Q\222mO!\350\r\r2\217\004\322\236\223\311\246\023\032jz\230\215\242\231\036jCj3M4\215\221\246'\251\246\211\352h%\t'\240\320\023ML\002\233E=2zF\246\201\372M&\217P\0004\000\000\014\200\003@4h\001\240\006\246\206\2011\002\236\222\031\032h\000\320=@\006\200\006\200\000\000\000\000\000\032\000\000\tM\020\232M4j\032eO\t\224\323hM2\000\332\200\320\320h\006\203@\r\000\032h\032\000h\003\023j\004\030\000&\000\0020\000\010\300\001\03214\300\023\000\000L#\010\300L\230\214@\300\222A\014\201M\251\223&Q\251\275\023$\362L\324\032\0324\310\003L\200\r\000\000\000\003 \000\036\246\203J`\257X\326\356\207\355\3648eL\223\t3o7\267\271\375t\203\246\335O\356D\242%\022$GM\332\222\224\024\352\310\261\202l\323\231\376\237\353!T\270w\377,1\031\311\241\213\256\272\260\243\376\320~}d\221YI\035\205\326\231YJ\304\\\231\206`\031\2230\314\014\310\031\206a\232\262\371\322@\274\024!ya.\367\344\347s\261\355\226k>\363:\025\331]\234\276\246\243!&L\223$!!!\220\206I\t\2223\334*\032\273\231\025\003i\315\027*\014\271L\0052\270\242\204\014\331\206.\261%s2a0\300\220\222ap\345\222\004 \255o\300\014\206@\322k\3155:)(Sg8\016\254N\352\354X\312N\272A\222v\244\231\223$\\X]d\360\312`\230lN;\023N\217 U=\020\037c\354\202\020\254Z#{\346\253#\212\340\317,\276\370\tz\373\303\016\270uU\313\024\021xb7\2459\021\013\026\245\306\370\236S2\371\222\301\364%\001\305u\204%s\010[\034mE\257\260\336\0063C\016,\014\031T\271\013\210A\242/\013\306, &J\242`]\252u\272\016\344\005uK\337\360\251\301\303\361\212\337F\260\370Y\330\303b\276\223\334\212\241\n\023\010%G\211\223\275\367\334\241\313(p\250\2352\212\224(\037w,\236\373n\252\306\316\247&l\2256\344\314\035psM)\034(\215\002E\0036\\\335\257z\0165\036(\233[be\307\352k9\264\024Lk\336\016+\016?\0348\342\266'\t'\024\023\235\262\"i\350\022i\210\342\361\265""\026#Q\213\036\253D\244\354\246Le\201\251]\n\342\360\2249\205I\252}\226\363\302r\270\234\302F\244\373;K;*\n\025\3703\026\361\271\030\376\347\\\366\340vj\272\007*j\372\212`;\245\316\332\236#\242l]\216\032o\351m}v\233\006\002l\347A\377\202\222\262\264\366\251\021\336*_4\363\335{6%\340\356\2728\361\370\344\034\343>z\354\311\301\242\352\347(\336\267GS\3226:IW\nM\310\333\341\261V\305`;\2739\321t=\264\032\033\001\253e\213lXu!\221!\353kH\272\304\327,c\3324l\r%\223(v*\007\342:\024\251\344F\221\206\233\222\245\204\245*\rR\311d\t\244\2260\330`\215'\300c\021nb\247\206\302\374\304\200\021\002\211D;\251}\250hk[\314\301\026Noj\003X,\234\rn\235,\017o9\271\006)8G \353\014\272\300s\023\315\267P\364T!\030\212\006[\240\t\255h\014\001\207~\360\227^e\233\306A77f\345\344nj\367\315G\207\034U\305\237\201\004\216\236:\253+\341\271\337\332[U\356^(\315\234\210\332a\235\266\265\315zP\212?1\336\223x{'\t\347?\266\333%\240\335\277\016\237\201\324H\223\216\222\\\222%\313y\316\035\320\222H\245\305\314\327\260`\034\274D\3100\3239\035\037\307}!\252\213\030fi\221\314\342\222\030\347p\367\254[\0357\220$\367\006\277\341Pi\236uE\245\207w\035\337\235S\315\230IY\3169\3649\034\376\360\371\35366\357\336I\335\335\335\357=y\201\233h\327\325m&\223\032'9KZ\257a\303S\235\t\212\257\0013lE\261'\2020\271\002\254O\230\223\247\253\252\211\325\225\022\331\260*\2632\253\023%)a\013\345\226\352eD\200\026\340Zfj\362\267\016:\304\202\320\311S\242\3076M\261\254\263$\222I.\026Z\231\260\374\302Tqe\264\034\242\361)\326+\302h'G\241\306\213W\334B[g\313\314\334\3368\240\234:\325\271\375T.\013\215\256R\371Jy9Yn\005\2622[\034\206\245\254\354y\345;\270;\253\226\373\210\243\335\032\363\335\311F\353\377b\247w\246\333\033\370\035^\353}\311]'\335\211uV\205\301\256S\023X(\315u\025]\3758\210\214Uv\246(\013D\350Uv\271\344^+\013\236P\304\026|\225p\2054B\032\222%\014\302w\223I\244\346\364\346\211\217+D\364r\303\265\3516\001\3109\271\2539{+\252\035\006B\276\326{\302i\301\215\272\271\000~\346pp\201|\246T\310\236GgB\207\352\304U\000\262\3423""\032\274\\\376\372\227\014AG(\023\304\314\324\252\252\021\202\0106\351\273\210\216Sc=\370m\362\3373T\2605\266\265\221B\327\274I\343\234\2344Z!\206,\205\264\\\027\204\236{\354Mqw\021%/\024\024=\360S\027E\004\224rK\026\t\305\234A\340\235)\270\333\270z\307B\2510E\241D \221\007$\366\t\032\373\375\215m\024\264\256A\304\002I'\037\241\236\350\306l&\251c\311;\216\230U\007rFXRrce\254\005\214\326\026~\233e-\275$\rT0\314\206\033\020\231\202\250\035\035\3055\020\324\342\027\224Y\320\306\024\023\rp4\266\262\333\263\030\213\201\202|\206Sn\300.rA\026\241\000\3412\001\222\035M\265\266\232\346Bi\246{ka\002R\021\002fid\026\241\2152\317\223h.\0144\253\216\375\326*\255\356E\021\211*Uf\030\247\006\374\317\252z\004F#\307\000v\024\034\\H\206j\251\242S\266\211S\306\215\016\024gm\033\035\022\264a@\264\232CM({\221\311\023\366E)K\2718\223\245\nR\311Q\023\211M@\360\311\204{\367\2064,\332\213R\r8i\210\030g\006\204\220\222Hd\230P\362\312\3450\034\323\316\236\335u9\246\r\016\213\326v*\204\310\265\210C\202""\244\221\257:\244\304\024Mvo(\026\303\3657\330\342Z\022\214\004Z$\306\025\270\036\263k\032\341\243\tI4\265\\`\203e\n\210\333R,}T\254\243\204I\332\013(\344\253:8R\006,\311\253\002\263O\024\212\027\254\027-K[\3456%\304BL\004\325\314\312\321\200B\013\232\001\301X%@9\014T, #F\202\013\275%7\250\274Q\033\346VUm\365\247B\032\023&C\220l\231K\244Z\3625\257\024\031\tm\206\323\003\221\256\2078q\035\034(\271\331\351{\350$HT\312N\201,\335c\334\352i\363W@KfNo\260*\026\240b\014o\225a\210\267~w\253$:\304JN\254\021m\357l\034\212\254p\201B.\022\"\301k@!v'>LUL\372\nF\234\221\037\nr\031#\311\217\203\027P\tQD\264\317\026\235\222\357,\023a\002\203\215#\014$\367\325\236\342'\021(\342\021\026Xi\323\210\230S\213\016Y\347Z\031S\033\261\333\262shZ\231\000\267i\215\340\031\nJZ\247\014/\321\255\273\270bS\277\037\223\005\003\223M\326k\351\347\254\321Ql\0148E\337\243\0108\361\215'\024\365N\231\365\237R`\031\220\367\034\276\246\320\033\351\\P\256\250n\257\234QoFE\027\345\330\203\207\211c\241\271\355x\240s\257\002\245\361\250\307\221\354\3121\267\303p\344<\333\177\026\241\325\207\242\255s\n\346\"\236\205\312\335\200\202Y\300\205\331\312\331\310\277\257b\253\223\0030\220D;n\361\01764T\3759|<|B\222\025T\350n\376\336q\221\275.O\025\037\220\336\313Ik\336\364\222\341\035\243\336\311\317\275\343gq\316T\204O\257C\235\363\350M\366\314\237A?\265\177E\032\362W\033\032\211\312\361\205\243E\302\275\235\364\"o\213P\014\366aE&\027\364\023e\216W?dW\227\236\351\376W>{*\211\244\264H9\234\2239\247\215a\206\247\231\304\367S\366\274)\303i\333\237\356\275\242\033\230\360\240\304D\242?\206\377x\233h\217mJ0\234`\212\214\323\224\232\2518\212\262$\313\320Ffd%l\023\033U\346\r2\255\214]X&\300\r\n\020G\212,\263Q\335\223\265\003L\202i\233\247\244G\237J\225\005A\313\356U4\216\314\327'\275\323\246\217E\250\352\017a\340\325y\022\327\032c#9\211\313\002\237\364\323\370\250\2634\322\243&\372S\2355:\006\340;\"\321i\242\271\235\266T(|!;\3072`P\240\356x\026\014n\373\\\372\221g_uec\342\312\226,\020+\342P\227\241c/\027E\322\356S\230\224""\326Q\266-\311\006n\024\224\214\252\304\231\031\235\266\327\t(U\324\317\005\305<1\233j\353\013\n\334L.j\336J\312w\223\021[\245[c\016\354\276\304\344rI\343\320d\272\304\"2\252\233\271\273\r\207\323\300\220\037RC\374\365\274\247w\020\347\317\213Z\257\254\221\202\231u\310\376+\305E\266:\367C,|\223#[+\256`\225:\347b\241\350\332\374\243\227\267\331E\341zv\357q\250\335\367\250\037\235\262\222\363\264\363\377\257\2574B4n\224i\306v\263\211_2]\272u\214\273\313\237\266\000\325.\340[\305\"E?\004!\354\345\213\272\005*GMu\255\253\036\213\014\037\263\016\330\252Y\026\265\251\027\021!\305\330}\237P}\361\360\037\243V\225\225\224K\\\343\177L\216x\013l\356,\334\3037\300E\237\255\351\024\373\224[<\305B\016\346\313!\352?s \237\002]y\375b0r\024\315\304\336>a\204\232\266\371\265\212Pu\257\357\325p\340\346\t\3425\324\345L\373|X\247\207i\023}]\230\224\255\253\2765p\361\232\347\311\223Z\355\035k\342\272\370\276B\275\261\322\0221\322\215\262\216\201e\244\305(V\272\220\222\262\330\213)8\345\2156Q^\023\212\036V<\037\232R\214\3506D\305\346,}AB\253\252\324\204\307\364\37431N\005kC\304\315L(%@\2240\354L\244A\352\363b\245a\344, \nxv\3356\322?\217\200\314\224\3103\010\3520\222\034\246F\014\275\210%#\377\213\271\"\234(H\001a\306\263\200"; + PyObject *data = __Pyx_DecompressString(cstring, 3256, 2); + if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) + const char* const bytes = __Pyx_PyBytes_AsString(data); + #if !CYTHON_ASSUME_SAFE_MACROS + if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } + #endif + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (3157 bytes) */ +const char* const cstring = "x\332\305V\313[\323\332\026\007\005O\325r\240R\304\007j\312C\336`\021Qy\350WQ\317\361x\217R@|@ON\332\354B\264M\332$\345P\365\336\357\014;\3140\303\0143\3140\303\014;\334\303\016\373'\370'\234\265v\332R\244x\365N.|Mv\326\332\353\261\327\343\267\366h\"\021\313d\236\344\013BfU\2215]\025$Y\347>s@|,\245\323D%\262~\204\361B\221\3113y_\310H\"\227R\2629A\025tE\345\352$%G|\302\357\222\274Q\310\036\021\335\022TIHfH\013\326\223\003!\245\237\264\277%\363w\341\340D\375\307Y`rMU\304\223\3349\306c&O\224h\315\005\263'\333h\301\303H\276Pt.\247h\232\004{\026\233\343\251\355)\205\214\310%\t7\272\2622\312\001e4\2622:\305I\032\310\351\204\323\367\004\235[-\352{\212\2144\221d\244$F\236d\212\034\230\220R:Qq\223\314\255=Y\233\236\2777\317\t\262\310\251\344=I\351\032\247\025\222\251\214\240iD\343\2244\227,H\031]\2229\275\230#\332\014\367,\315\025\225\002'\023\"r\272\302\345`_\263\200\276GdN#:.\270QA\226\025]\320%E\346A\\\222wG9QR\301\210\264OP\372\251\220\321\310\314:\361}\202m\215\220h\334\354\304\216\377?91\021Y\341\306\226W\306\2478\356\334\314\303\007+\017\226?\257\254LO\216m\013\323\037c\323\357\370\341[\323\367\023\023\343\207\337\211\2578\202(\3622\006\006\217\231j\204y\026\342\251\021u&W\334\236\234N<\334\021'E\222\346\3241Q\322\320\007\"\343s7\345'$\235Q\204zb0\2502\221\340\214*'\260\210\312\273\230\205\246\014J\232/.f$M\337\006j\202-\364B.C\266\017\367Mq\r\376\024*\252\031H\264\336\r\\X5\311$\022\347\270\332\337\330\303\345\310\316\3048\206\314'|\206\337\020\227\025\364\324\03671\001y\3249\210\001,'\232eV\266w\376\032\337\021\023\343;\323\r\231\244$\013j\221\233^\344r\220,\"B\252\223En_Pg\345B\026\ni6\225Q4<\362xC\323\366\344\316\304l\202;\372W\267>9\305MLq\263\376f\364\001\313\251 \023\036\3539\253q\030:\177\271\355\277xI\026\311\301\366\350\370\"\024\245^Pen\331\017\362\203\326\310s\034\244V\241Y\244\014&\340iAf\245\325\314\253\257Z\264\352q89\256\240N\331\204\2268\326\273_\343\3131\000\371\032\340x~\255x\000\277\307\320\002\374\013r\240\257\223\364\326\223\365G/7\236|\003RN""\206\277\023Q\345$\004<\021\352N\202d\236\25756\201\225V\224S\2222\223RT\245\0008A4\236g`\300\357\022]\322I\026?\201\014)\345A:E\222B\352\003\326\017I)\207\030w\270\322\232\226|Z)\310b3\001*EJ\021\266G\312\220\332\213\327k\272\231\273u\246x\224V_\036\256fZ\362g|\224h\342\201E]T\262\260\206&\027\tV\236\244K\244\346\035\201YG\016\240o\016\240{\016\360\314:_\037|Z\032Z+#}<\342\013\320D!\223\301\027\004LM\253J\366\003)B\034\323Pg\376s\227\310\250n\027b\234\223Xs@H\277\262\313K\032\337\310\002\254\025\225GW4\014\206\337\267\230\016\rT\243\366\014I\353\370C\026{\253\004\017$\022\225}i\177\t9H\035\222\360\t]\\\313\020[c\222\263\212X\200H\303\237,d\341\r\016\352\370\3435]\311\371\366\024%\235\206YP?|#\010\215\205\357\370\341'\232>\374R\245\335==\307\020\301\207\205\0328\0244\"6-yDC\226#8Cc\222h\307)3\313\031%\005\001y0S\013\347\267\266\250$\227\201j\345\033\226\277s'\257\345 )\337\332\017\351\250\245\256\330T\004?\344\\k\025\377E\"[\2009\016\363\344\273\243\344\327\r\224M\352[~\376\250\343\337\241\362\20750\001\261Y\3428\005\216\252Cw\3119)\365\201\r\206\234\222\203\006\335g\365\312\363\030N\277\220U\025\246\313.9\250\225\375~\r\004[\321\260\307\230\027\202\254\327\312\340h5\264\252\r\360\251\311\255f\017\233\327\200\232D\220\211\330\212\306\027d)_ GX>\251\016\207\376\324d\r\304\036\0303\177\321hs\377\023\373\034.n\202\232\332C,\343y\350\327ZC\303\n\256C\002T\rs\233=\216\004\224Qt\"\302\361U\035\310\310\311\301]\020u\346\300KM\002\\OK@\347\021\201\341Z#\303\366l\016\276rE\236\327A\025<\367T\345\257\326\365|R\315\266,\201\246\373\004\273\251B<\024\271\026\224\006\244|\375\315\000\347\030\221Ef\037\240\263@\330C\203t\037f\374\210l\013\262/]\247k\205\\NQ!H\207;\032\274\257\r\327\031\207\013\036.\316h\306\212:\321\277c\225\276A+R9{\356\313\231\266\263\301\322\355\222P:04s\310\214\233B%\330kD\221>`\316\231o\254\270\225\266c\225\3005s\335<\260\362\366\031[\250\006\316\227\356\030\035F\314\3300\333\351\345I{\316\336pN9\303\216\340hn\204.\275,\2534\276""\316\324T\002}\264o\204\351X\265\363\364\326#o\320\373\205>O\320\304\037\364\017\036\215\204\215%3m\305\2548jE?>\232\275\346\252\231\267\002tl\321\215T\203\335\245O\350W\245\247\237\366\217\333\241Jh\000\331\354s\332\216\243\225E3N\257o\322\315W\364\325V%\320]\312\303\361\002?\2272\346M\253\335\nU@\357|I3\"\225`\330X5\362f;\310\320^\364z\313\231s\342U\364\363\357X\365\333\022\375\206nF\315\030;\024\223\240m\003\346\257V\354K\260\2553\010\273\367\215u\343\000\274\356\264\342p\252\316\356\222\360\345\034\276\222F\300l7/[7\355Sv\244\322q\276\024-\305J[\306mC4G\314\274\0237\342\264c\326\376\217\013\307\217\240\345`\351\0274\320\315\3221l\246\254~\373\264\035\255\364\014Z\243v\0104\364\204\252\301+f\304\\\260.Z\005\310Kp\320\032\204\350m\331Q\373\261\323\356\204\235\270#\272\303.\361\346\274\267e\241\254\321\365\327\364\365\033\372&M\323\273\025P\013\247\242\275c\250\263zDg\217q\326\3543\005S\263\"\026\230\033\200\243\366\014\320\201Y;\357\234q\222\356)7\342\336v\223^\247\267U\236+\277\206X\203T%<\312\n\"\t\311\2178\013\356EW\365z\275\030}\362\216\276\333\241;)\232B\253tw\257nj\334\211:\277\271\357\313g\312\202\237\247\366Jh\004}\257t\236\371r\261\255\363*\2752e\307\354\204\013\221zY\316W:\002\245.\203\267b\230\220E#nd-\026\032H\3765z\355\276\033\202\362\350\271n\356Bye\235e\027k\302\370lE\255\347\366G\340\r\273\273^\234\355\304C@\n9\353'K\265\007\234\204\027\251t\365CZ\273\240\350j\324kN\326\003\335\027\214\t3f\376aG\351\3246\335\2063\374I\377\024\250\220\304\224\006K\220\363k\330\020\325\216\316j d\204\301#v\216\217f\310\034\267\356\330\355\354P\225\363\301*\276i\333\010\035Yq\337z\002J\017\230\321J\007\204\013d\277\364\264\301q\303m\235\203\326u\314\374\227\271\266\316\033f\326\276\343\004\334\237a\267\n\333\317@\343\030\257\3141\277G\027\332:/\032P!7\240\300\332\255K\020\311\021[w\346\235\202\013\241\271i\211v\304\236\267\213n\273\033\252\302\247@G\227\334\005/\344\ry\233\345>\0145\0366\010U\262aw\330O\234\020\372\023\306\016\210\332\261j\307u\350x\010\364O\340y`""\010r\317:\035P\202\016/\322\3055\272\006\215\005\371\334\256\004\256\232\363h\277\202n`F\356\032\243f\330\334\004\177\372\235\366j\260\013\2134b\335\266R\320\244=a\032\276i%\241\316n\333\002|\031\217\315\237\350\215\250\023r\"M_\027\034\250B\210\322]'\357\236v!\376Ct\350\236\333N\357\377^\206\306\356\246\335\303\326*\204\254g\224\216\256\270q\372`\235\256o\200ez\236\263Nc)\014Y\367X\335w:q\272\200L\272\261\211~\336\265\006\301{\250\016\3547;\342D\254\010\340R\307\244\275\302\002|\004\362\006\001M>A\023\260\306\016\\4\004c\337\334\262\026\354>\360;0`>2\367,\301\322 \340y\347gW\250\201\024\355\036\264\206\254\370!\304A\324\255<*\356.\355\031\304\274g1\000\275B/O@n`\313\025z\205\205\273R\227\277a\252\326\005k\0364G\350\344\262\373\010T\373\312\330\321\260\344#V/\302\"\234\207^\275\005M(8\371\2064\343aE\237\306<-\271s.\370\202\210\366\332\201\276\235s\306\350b\034 \270\2121\234B\344\255Bk\300c\226\316>//\000\007\003\t\235\244\003\020Azz\215y\340B\302\010\370\270\312\272%\314Y\335\366\001\344\245\023T\207}\220y\005gY\004\200\371\000\265\025\201\363\301\2517\241\026\207\3548\304*\034\201j>*@G\036y\021o\t`h\037\220\231n\275\376?\230\004\231\256^c\014\300\026\206W%\010h0c\0136\254\256\323\3535\\`E\006\315\033\034\201\006i\207\342\r\336\2407\346\235\247\000y\321/\001\230P\010\230H\017@Q\2173\304\004\230~\006\303\257\023\252\377\nTx\332y\354\236\365\372\313\235\345M\032\007\340H\322d\252\032\304\204C\267U\203\227\314S\330\311t\010 \013\375\351A\024\206\261\227\002\300\307\274\200A\034h\027\215\367\320\335\003v\234\316\374\253\034+o\32378&+\330XP\031\306#c\017\360\371\337\366\013w\320\215\201\232\320%\003+\256k\322\036\203\246\002k\367\234h%8\006-\036\203q\334N\243\317\312\027\313y\272\206M\001x]\255\351\241\341Y[\303.\304\371\337\323\347\217\360[\316i\030\205\033\330\204t\031v\343\314\250\366\260\300\320\261\207\000\353!\224\205\304\321\3769g\310Yw4\272\350\353\205\235\014\035\302\375\306'\326\022\227.W\006\026\240X\213\336)o\330\223p\002mTnp\225\310\222\033u\237yqO,\217""\327<\272\354\2677J\314;1\347-\314\227\016\357Yy\203\256\305\231\004\"\374\270\027\365\036\227\317\372%\373?H\364a\2725\3609~\324E\204\234\263\336\005o\336+\372!b\362\313n\014\001\333\323\313\367\375\353D\263\305;P\207\022\304\"\014\2235\205\027\034\224\000\224q\357{1@\332\313>\376\374\270\004\324XW\330\277q\205\214\3630'\202]\245wF\301|j\r[\357\235\263n\277w\276\274D\267 \3140\215D*\022,\312\013\006\273\246,\031)3\204m\005\315\r\327\002,\213\253&\214\267K\346iT\364\025\035M\364\301\265\355-\316L\000%\000\277_\331Xh\267{\261T\235i\367\020cj\030\313\256\014\306=\363\266\231\004\302\"\"\014\003\023\320u\341Z\343&\346\267\005\273\232\025\340\370\237X\300\221\2017\204\363\364\366o\3647,\023\230\251\337\267\311\237\304\364\332\034\\,\242\3765\361!\273\231\3707\201j\375\212\0326\356C\234\200q\362\355\261\210\241`.WBW\374\233do\255\371\302\000\255>\034\364\341i\357\300\270ZrR\256\317\300\233\3106\275\367\222\276\254]\002\276oS+\033\323\014\256\216\212W\221\201\020\361\234\336}A_\340u\230\362\177\266\262qlS\325\207\n\032\301\036\210\263K\207\2257\363\377\000u\330\030\273"; + PyObject *data = __Pyx_DecompressString(cstring, 3157, 1); + if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) + const char* const bytes = __Pyx_PyBytes_AsString(data); + #if !CYTHON_ASSUME_SAFE_MACROS + if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } + #endif + #else /* compression: none (6497 bytes) */ +const char* const bytes = "']]AllEqualConstraint | AllDifferentConstraint | NoneInvalid comparator Invalid operator MinSumConstraint | VariableMinSumConstraint | ExactSumConstraint | VariableExactSumConstraint | MaxSumConstraint | VariableMaxSumConstraint | MinProdConstraint | VariableMinProdConstraint | ExactProdConstraint | VariableExactProdConstraint | MaxProdConstraint | VariableMaxProdConstraint | NoneNot possible: comparator should be '==' or '!=', is Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.Restriction Variables /*\\*\\*\\*\\+**!= (<=), \n.?>=><|==-+([a-zA-Z_$0-9]*)([a-zA-Z_$][a-zA-Z_$0-9]*)add_note and constraint/parser.py[+-]?\\d+def r(disableenablegcint | float | None is neither a string or Constraint isenabledlist[str]list[tuple[Constraint, list[str], str | None]]list[tuple[Constraint | str, list[str]]]\n (?AllDifferentConstraintAllEqualConstraintCompilableFunctionConstraintConstraintExactProdConstraintExactSumConstraintFunctionConstraintFunctionTypeMaxProdConstraintMaxSumConstraintMinProdConstraintMinSumConstraint__Pyx_PyDict_NextRefVERBOSEVariableExactProdConstraintVariableExactSumConstraintVariableMaxProdConstraintVariableMaxSumConstraintVariableMinProdConstraintVariableMinSumConstraint__annotate__asyncio.coroutines__class_getitem__cline_in_tracebackcloseco_constscode_objectcomparatorcomparatorscomparators_foundcomparators_indicescompilecompile_to_constraintscompiled_constraintsconstraintconstraint.constraintsconstraint.parserconstraintsdictdomainsendequalities_foundevalexecexprextract_operatorsfinalized_constraintfindallfinditerfromkeys__func__funcgenexprgroupiindexinequalities_found_is_coroutineis_or""_evals_to_numberitemskeykeysleftleft_numleft_remainderleft_swapm__main__match_objectmatches__module____name__nextnext_stopnumberooffsetoperatoroperatorsoperators_foundoperators_leftoperators_rightpparamparamsparams_usedparams_used_listparse_restrictionsparse_restrictions..genexprparse_restrictions..replace_paramsparse_restrictions..replace_params_splitparse_restrictions..to_equality_constraint..genexprparse_restrictions..to_equality_constraintparse_restrictions..to_multiple_restrictionsparse_restrictions..to_numeric_constraint..genexpr..genexprparse_restrictions..to_numeric_constraint..genexprparse_restrictions..to_numeric_constraintparsed_restrictionparsed_restrictionspatternpicklablepopprev_stop__qualname__rreregex_match_variableregex_match_variable_or_constantreplacereplace_paramsreplace_params_splitresrestrictionrestrictionsrestrictions_cleanedrestrictions_cleaned_uniquerestrictions_unique_indicesreturnrightright_numright_remainderright_swapssearchsend__set_name__setdefaultsplitsplit_restrictionssplittedstartstrstripsubswapped_side_first_componenttemp_copy__test__throwto_equality_constraintto_multiple_restrictionsto_numeric_constrainttune_paramstypesunionunique_operatorsunique_operators_leftunique_operators_rightvvaluevaluesvarvariable_operators_leftvariable_operators_rightvariable_supported_operatorsvariable_unique_operatorsvariablesvariables_on_left\2401\2601\200A\330\025\"\240!\330\t\n\360\006\000\t\014\2103\210a\210x\220s\230#\230Q\230a\330\014\023\2201\360\006\000\t\034\2302\230X\240Q\240f\250A\330\010\035\230R\230x\240q\250\006\250a\340\010\013\2105\220\004\220A\220S\230\001\320\031+\2502\250S\260\002\260$\260a\260s\270!\320;O\310r\320QR\330\014\023\2201\330\010\025\320\025%\240Q\240f\250C\250q\3200B\300\"\300G\320K]\320]^\320^_\360\006\000\t\024\220;\230f\240A\240Q\340\010\013\2103\210a\210z\230\023\230C\230q\240\010\320(:\270!\340\014\017\210{\230#""\230Q\330\020\027\320\027)\250\021\330\021\034\230C\230q\330\020\027\320\027-\250Q\330\014\023\220:\230Q\320\036T\320TU\320UV\330\010\017\210q\200A\330\010\016\210l\230&\240\001\240\021\330\010\013\2104\210s\220!\330\014\024\220C\220q\230\001\330\014\023\320\023+\2502\250V\2602\260Q\340\014\023\2201\200A\340\010\016\210l\230&\240\001\240\021\330\010\013\2104\210s\220!\330\014\024\220C\220q\230\001\330\014\027\220t\2301\230A\330\014\023\2201\340\014\023\2201\320\000\034\230H\240A\360\014\000\005\014\2104\210v\220R\220x\230q\240\005\240Q\360\006\000\005\017\210a\360\n\000\005\017\210b\220\010\230\001\230\031\240&\250\002\250!\330\004\013\2101\210A\210V\2203\220d\230%\230q\260Q\220Q\320\004/\250~\270Q\340\010!\240\021\330\010\014\210G\2201\340\014\017\210x\220s\230$\230c\240\027\250\003\2501\330\020\"\240'\250\021\250!\330\020\021\340\014\032\230!\2306\240\026\240u\250A\330\014\"\240\"\240A\240V\2501\250D\260\001\260\024\260Q\260d\270$\270e\3002\300Y\310a\310s\320RW\320WX\320Xf\320fg\330\014\017\210s\220!\320\023(\250\003\2501\340\020\"\240'\250\021\250!\330\020\021\340\014\020\220\t\230\025\230a\230s\240!\2401\330\020\034\230A\330\020\034\320\034/\250q\260\006\260b\270\002\270!\2703\270b\300\005\300V\3102\310W\320TU\330\020\021\330\024'\240q\250\006\250b\260\002\260!\2606\270\026\270r\300\023\300A\320EZ\320Z\\\320\\c\320cf\320fg\320gh\340\020\"\240'\250\021\250)\2601\260J\270j\310\006\310a\330\010\017\210q\200\001\330\021%\240V\2501\330\005\006\360\026\000\005\033\320\032,\250A\250]\270!\330\004O\310q\330\004\010\210\r\220_\240A\330\010\013\210:\220Q\220m\2401\340\014\017\210q\330\020\035\320\0359\270\021\270!\340\020\036\230g\240Q\240m\260<\270q\330\020\027\220|\2401\240K\250z\270\021\270$\270g\300Q\330\020\035\320\035/\250q\260\001\330\014 \240\007\240r\250\034\260]\300!\330\r\027\220q\230\r\240Q\340\014 \240\007\240r\250\035\260m\3001\340\014\022\220*\230A\230^\2501\320,[\320[\\\320\\`\320`a\320ab\360\006\000\005\014\2101\320\000\035\230X\240Q\340\004\005\340\010""\021\220\024\220Q\220a\330\010\017\210z\230\021\230)\2405\250\001\330\010\017\210q\330\013\014\340\010\017\210q\320\000%\320%=\270Y\300a\360\006\000\005\034\2301\330\004'\240q\340\004\005\360\020\000\005\006\360\024\000\005\"\240\036\250~\270Q\3602\000\005\037\230m\2505\260\010\270\016\300a\360r\006\000\005\006\330\010\025\220U\230(\240!\330\t\n\3606\000\005\026\220Q\340\010\037\230q\240\001\240\030\250\021\250%\250t\2604\260u\270A\330\010&\240d\250!\2504\250y\270\001\270\021\340\010&\240a\320';\2706\300\021\300#\300T\310\025\310a\330\010\027\220q\230\014\240A\240S\250\004\250E\260\021\360\006\000\005\024\320\023+\2501\250A\340\004\036\230a\330\004\010\210\007\210q\330\010#\2401\330\010\035\230R\230t\2401\320$:\320:P\320PT\320TZ\320Z[\330\010\033\2304\230q\240\001\330\010\037\230q\330\010\013\2107\220'\230\024\230T\240\030\250\027\260\001\340\014\r\330\020\"\240!\2403\240c\250\021\330\020\024\320\024&\240b\250\003\2503\250a\330\020\024\220D\230\007\320\0371\260\021\260!\330\020\024\220D\230\007\320\0371\260\022\2601\340\020%\320%7\260q\270\003\2701\340\014#\320#8\270\001\3209M\310Q\330\014\017\320\017$\240C\240q\340\020'\320'=\270Q\320>R\320RS\330\010\013\320\013 \240\003\2401\340\014#\2408\2501\250D\260\005\260Q\3206R\320RS\320ST\330\010\033\2307\240\"\320$:\270!\340\004\013\2101\250!\260!\240!\270!\320\004+\250=\270\016\300a\360\006\000\t\014\2103\210a\210x\220s\230\"\230C\230{\250!\330\014\023\2201\340\010\026\220a\220v\230V\2406\250\025\250a\330\010\034\230B\230h\240a\240s\250%\250q\260\016\270a\340\010\013\2103\210a\320\017\"\240#\240Q\330\014\023\2201\330\010\025\320\025&\240a\240q\360\006\000\t\017\210h\220e\2308\2401\360\006\000\t\032\320\031*\250!\2501\330\010\032\320\032+\2501\250A\330\010\013\2103\210a\320\017\037\230r\240\022\2404\240s\250!\320+<\270B\270a\340\014\023\2201\330\010 \240\003\2401\240A\330\010!\240\023\240A\240Q\330\010\033\320\0330\260\006\260a\260q\330\010\013\2103\210a\320\017!\240\023\240A\330\014 \240\003\2401\320$;\2702\270Q\330\014+""\2502\250W\260A\330\0202\260(\320:Q\320QR\340\014\017\320\017,\250C\250q\340\020\027\220q\340\020/\320/K\3106\320QR\320RS\330\014\017\210t\2203\220a\330\020\023\2204\220q\340\024&\240e\2501\250C\250q\260\001\330\024 \240\017\250x\260q\270\005\270Q\330\024\"\240\"\240A\240U\250!\250:\260Q\260k\300\021\300!\360\006\000\025&\240T\250\021\250#\250Q\250a\330\024!\240\036\250x\260q\270\005\270Q\330\024\"\240\"\240A\320%B\300!\300;\310a\310v\320UV\320VW\330\014\017\210t\2203\220a\330\020\023\2204\220q\340\024&\240e\2501\250C\250q\260\001\330\024 \240\017\250x\260q\270\005\270Q\330\024\"\240\"\240A\240U\250!\250:\260Q\260k\300\021\300!\360\006\000\025&\240T\250\021\250#\250Q\250a\330\024!\240\036\250x\260q\270\005\270Q\330\024\"\240\"\240A\320%B\300!\300;\310a\310v\320UV\320VW\360\006\000\r\023\220(\230%\230x\240q\330\014\035\320\035.\250a\250q\330\014\036\320\036/\250q\260\001\330\014$\240C\240q\250\001\330\014%\240S\250\001\250\021\330\014\037\320\0374\260F\270!\2701\360\010\000\t\024\320\023(\250\001\250\021\330\010\024\320\024)\250\021\250!\330\010\014\210I\220S\230\005\230T\240\032\2503\250f\260D\270\t\300\027\310\005\310T\320Q[\320[b\320bc\340\014+\2501\250E\260\021\340\014\030\230\002\230(\240!\320#9\270\021\360\006\000\r\020\210s\220!\220;\230c\240\021\330\020\027\220q\330\014\037\230q\330\020\026\220j\240\001\240\034\250Q\320.L\310A\310[\320X]\320]^\330\014\r\330\020\023\2201\220B\220h\230a\230}\250N\270\"\270A\360\006\000\021\030\220q\360\006\000\r+\250(\260!\330\014+\2508\2601\330\014(\250\004\250A\250S\260\001\3201I\310\026\310q\320PS\320ST\320TU\340\014\r\330\020\023\2201\320\024/\250s\260!\330\020\"\240!\330\020\025\220S\230\001\320\0310\260\003\2602\260S\270\003\2701\320__pyx_string_tab; + Py_ssize_t pos = 0; + for (int i = 0; i < 211; i++) { + Py_ssize_t bytes_length = index[i].length; + PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL); + if (likely(string) && i >= 54) PyUnicode_InternInPlace(&string); + if (unlikely(!string)) { + Py_XDECREF(data); + __PYX_ERR(0, 1, __pyx_L1_error) + } + stringtab[i] = string; + pos += bytes_length; + } + for (int i = 211; i < 230; i++) { + Py_ssize_t bytes_length = index[i].length; + PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); + stringtab[i] = string; + pos += bytes_length; + if (unlikely(!string)) { + Py_XDECREF(data); + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + Py_XDECREF(data); + for (Py_ssize_t i = 0; i < 230; i++) { + if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = stringtab + 211; + for (Py_ssize_t i=0; i<19; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif + } + { + PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0; + int8_t const cint_constants_1[] = {0,-1,1}; + for (int i = 0; i < 3; i++) { + numbertab[i] = PyLong_FromLong(cint_constants_1[i - 0]); + if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_number_tab; + for (Py_ssize_t i=0; i<3; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_codeobjects ### */ -\ - typedef struct { - unsigned int argcount : 2; - unsigned int num_posonly_args : 1; - unsigned int num_kwonly_args : 1; - unsigned int nlocals : 6; - unsigned int flags : 10; - unsigned int first_line : 9; - unsigned int line_table_length : 16; - } __Pyx_PyCode_New_function_description; +typedef struct { + unsigned int argcount : 2; + unsigned int num_posonly_args : 1; + unsigned int num_kwonly_args : 1; + unsigned int nlocals : 6; + unsigned int flags : 10; + unsigned int first_line : 9; +} __Pyx_PyCode_New_function_description; /* NewCodeObj.proto */ static PyObject* __Pyx_PyCode_New( const __Pyx_PyCode_New_function_description descr, PyObject * const *varnames, PyObject *filename, PyObject *funcname, - const char *line_table, + PyObject *line_table, PyObject *tuple_dedup_map ); @@ -15834,99 +16633,109 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { PyObject* tuple_dedup_map = PyDict_New(); if (unlikely(!tuple_dedup_map)) return -1; { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 84, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 84}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_v}; - __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 84, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 84}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__25, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__25, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 95, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 95}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 140, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 140}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 168, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 160}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_var}; + __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 169}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__26, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__26, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 169, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 170}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 172, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 175}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__27, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 238, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 267}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_o}; - __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 245, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 274}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__27, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; - } - { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 148, 45}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_number}; - __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_is_or_evals_to_number, __pyx_k_XQ_Qa_z_5_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__28, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 288, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 317}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s}; - __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__27, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__28, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 298, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 327}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_r}; - __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 36, 50}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 38}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_match_object, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_param}; - __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_replace_params, __pyx_k_A_l_4s_Cq_2V2Q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_replace_params, __pyx_mstate->__pyx_kp_b_iso88591_A_l_4s_Cq_2V2Q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 44, 50}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 46}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_match_object, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_param}; - __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_replace_params_split, __pyx_k_A_l_4s_Cq_t1A_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_replace_params_split, __pyx_mstate->__pyx_kp_b_iso88591_A_l_4s_Cq_t1A_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 54, 251}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 56}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_restrictions, __pyx_mstate->__pyx_n_u_split_restrictions, __pyx_mstate->__pyx_n_u_res, __pyx_mstate->__pyx_n_u_comparators, __pyx_mstate->__pyx_n_u_comparators_indices, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_temp_copy, __pyx_mstate->__pyx_n_u_prev_stop, __pyx_mstate->__pyx_n_u_next_stop, __pyx_mstate->__pyx_n_u_m}; - __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_to_multiple_restrictions, __pyx_k_Q_G1_xs_c_1_6_uA_AV1D_Qd_e2YasR, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_to_multiple_restrictions, __pyx_mstate->__pyx_kp_b_iso88591_Q_G1_xs_c_1_6_uA_AV1D_Qd_e2YasR, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 47, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 79, 2029}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_restriction, __pyx_mstate->__pyx_n_u_params, __pyx_mstate->__pyx_n_u_comparators, __pyx_mstate->__pyx_n_u_comparators_found, __pyx_mstate->__pyx_n_u_comparator, __pyx_mstate->__pyx_n_u_left, __pyx_mstate->__pyx_n_u_right, __pyx_mstate->__pyx_n_u_supported_operators, __pyx_mstate->__pyx_n_u_operators_left, __pyx_mstate->__pyx_n_u_operators_right, __pyx_mstate->__pyx_n_u_unique_operators_left, __pyx_mstate->__pyx_n_u_unique_operators_right, __pyx_mstate->__pyx_n_u_unique_operators, __pyx_mstate->__pyx_n_u_variables_on_left, __pyx_mstate->__pyx_n_u_swapped_side_first_component, __pyx_mstate->__pyx_n_u_right_remainder, __pyx_mstate->__pyx_n_u_left_swap, __pyx_mstate->__pyx_n_u_left_remainder, __pyx_mstate->__pyx_n_u_right_swap, __pyx_mstate->__pyx_n_u_is_or_evals_to_number, __pyx_mstate->__pyx_n_u_is_or_evals_to_number, __pyx_mstate->__pyx_n_u_left_num, __pyx_mstate->__pyx_n_u_right_num, __pyx_mstate->__pyx_n_u_variable_supported_operators, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_variable_operators_left, __pyx_mstate->__pyx_n_u_variable_operators_right, __pyx_mstate->__pyx_n_u_variable_unique_operators, __pyx_mstate->__pyx_n_u_number, __pyx_mstate->__pyx_n_u_offset, __pyx_mstate->__pyx_n_u_operators, __pyx_mstate->__pyx_n_u_operators_found, __pyx_mstate->__pyx_n_u_operator, __pyx_mstate->__pyx_n_u_splitted, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_to_numeric_constraint, __pyx_k_A_3axs_C_1_avV6_a_Bhas_q_a_3a_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 41, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 81}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_restriction, __pyx_mstate->__pyx_n_u_params, __pyx_mstate->__pyx_n_u_comparators, __pyx_mstate->__pyx_n_u_comparators_found, __pyx_mstate->__pyx_n_u_comparator, __pyx_mstate->__pyx_n_u_left, __pyx_mstate->__pyx_n_u_right, __pyx_mstate->__pyx_n_u_operators_left, __pyx_mstate->__pyx_n_u_operators_right, __pyx_mstate->__pyx_n_u_unique_operators_left, __pyx_mstate->__pyx_n_u_unique_operators_right, __pyx_mstate->__pyx_n_u_unique_operators, __pyx_mstate->__pyx_n_u_variables_on_left, __pyx_mstate->__pyx_n_u_swapped_side_first_component, __pyx_mstate->__pyx_n_u_right_remainder, __pyx_mstate->__pyx_n_u_left_swap, __pyx_mstate->__pyx_n_u_left_remainder, __pyx_mstate->__pyx_n_u_right_swap, __pyx_mstate->__pyx_n_u_left_num, __pyx_mstate->__pyx_n_u_right_num, __pyx_mstate->__pyx_n_u_variable_supported_operators, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_variable_operators_left, __pyx_mstate->__pyx_n_u_variable_operators_right, __pyx_mstate->__pyx_n_u_variable_unique_operators, __pyx_mstate->__pyx_n_u_number, __pyx_mstate->__pyx_n_u_offset, __pyx_mstate->__pyx_n_u_operators, __pyx_mstate->__pyx_n_u_operators_found, __pyx_mstate->__pyx_n_u_operator, __pyx_mstate->__pyx_n_u_splitted, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_to_numeric_constraint, __pyx_mstate->__pyx_kp_b_iso88591_a_3axs_C_1_avV6_a_Bhas_q_a_3a_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 269, 222}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 298}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_restriction, __pyx_mstate->__pyx_n_u_params, __pyx_mstate->__pyx_n_u_equalities_found, __pyx_mstate->__pyx_n_u_inequalities_found, __pyx_mstate->__pyx_n_u_comparator, __pyx_mstate->__pyx_n_u_splitted, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_to_equality_constraint, __pyx_k_A_3axs_Qa_1_2XQfA_Rxq_a_5_AS_2S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_to_equality_constraint, __pyx_mstate->__pyx_kp_b_iso88591_A_3axs_Qa_1_2XQfA_Rxq_a_5_AS_2S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 28, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 30, 391}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 28, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 32}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_restrictions, __pyx_mstate->__pyx_n_u_tune_params, __pyx_mstate->__pyx_n_u_regex_match_variable, __pyx_mstate->__pyx_n_u_regex_match_variable_or_constant, __pyx_mstate->__pyx_n_u_replace_params, __pyx_mstate->__pyx_n_u_replace_params, __pyx_mstate->__pyx_n_u_replace_params_split, __pyx_mstate->__pyx_n_u_replace_params_split, __pyx_mstate->__pyx_n_u_to_multiple_restrictions, __pyx_mstate->__pyx_n_u_to_multiple_restrictions, __pyx_mstate->__pyx_n_u_to_numeric_constraint, __pyx_mstate->__pyx_n_u_to_numeric_constraint, __pyx_mstate->__pyx_n_u_to_equality_constraint, __pyx_mstate->__pyx_n_u_to_equality_constraint, __pyx_mstate->__pyx_n_u_restrictions_cleaned, __pyx_mstate->__pyx_n_u_restrictions_cleaned_unique, __pyx_mstate->__pyx_n_u_restrictions_unique_indices, __pyx_mstate->__pyx_n_u_parsed_restrictions, __pyx_mstate->__pyx_n_u_res, __pyx_mstate->__pyx_n_u_params_used, __pyx_mstate->__pyx_n_u_parsed_restriction, __pyx_mstate->__pyx_n_u_params_used_list, __pyx_mstate->__pyx_n_u_finalized_constraint, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_i}; - __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_parse_restrictions, __pyx_k_Ya_1_q_Q2_U_x_U_6_Q_q_t4uA_d_4y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_parse_restrictions, __pyx_mstate->__pyx_kp_b_iso88591_Ya_1_q_Q2_m5_ar_U_6_Q_q_t4uA_d, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 336, 177}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 366}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_picklable, __pyx_mstate->__pyx_n_u_parsed_restrictions, __pyx_mstate->__pyx_n_u_compiled_constraints, __pyx_mstate->__pyx_n_u_restriction, __pyx_mstate->__pyx_n_u_params_used, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_code_object, __pyx_mstate->__pyx_n_u_func_2}; - __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_compile_to_constraints, __pyx_k_FBVVW_A_UUV__A_Qm1_q_9_gQm_q_1K, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_compile_to_constraints, __pyx_mstate->__pyx_kp_b_iso88591_V1_A_Oq__A_Qm1_q_9_gQm_q_1Kz_gQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 404}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_number}; + __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_is_or_evals_to_number, __pyx_mstate->__pyx_kp_b_iso88591_XQ_Qa_z_5_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 416}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_expr, __pyx_mstate->__pyx_n_u_pattern, __pyx_mstate->__pyx_n_u_matches, __pyx_mstate->__pyx_n_u_m}; + __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_extract_operators, __pyx_mstate->__pyx_kp_b_iso88591_HA_4vRxq_Q_a_b_1AV3d_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; @@ -15939,27 +16748,42 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitGlobals(void) { /* PythonCompatibility.init */ if (likely(__Pyx_init_co_variables() == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) - - /* AssertionsEnabled.init */ - if (likely(__Pyx_init_assertions_enabled() == 0)); else - -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + /* CommonTypesMetaclass.init */ + if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* CachedMethodType.init */ #if CYTHON_COMPILING_IN_LIMITED_API -{ - PyObject *typesModule=NULL; - typesModule = PyImport_ImportModule("types"); - if (typesModule) { - __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - } -} // error handling follows -#endif + { + PyObject *typesModule=NULL; + typesModule = PyImport_ImportModule("types"); + if (typesModule) { + __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + } + } // error handling follows + #endif + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + /* CythonFunctionShared.init */ + if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + /* AssertionsEnabled.init */ + if (likely(__Pyx_init_assertions_enabled() == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + /* Generator.init */ + if (likely(__pyx_Generator_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -16000,7 +16824,7 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { } #endif -/* PyErrExceptionMatches */ +/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; @@ -16041,7 +16865,7 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta } #endif -/* PyErrFetchRestore */ +/* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 @@ -16100,7 +16924,7 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject } #endif -/* PyObjectGetAttrStr */ +/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); @@ -16110,7 +16934,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject } #endif -/* PyObjectGetAttrStrNoError */ +/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare @@ -16149,7 +16973,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { return result; } -/* TupleAndListFromArray */ +/* TupleAndListFromArray (used by fastcall) */ #if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) @@ -16162,11 +16986,11 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; for (i = 0; i < n; i++) { - if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { + Py_INCREF(src[i]); + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) { Py_DECREF(res); return NULL; } - Py_INCREF(src[i]); } return res; } @@ -16205,7 +17029,7 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) } #endif -/* BytesEquals */ +/* BytesEquals (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) @@ -16253,7 +17077,7 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq #endif } -/* UnicodeEquals */ +/* UnicodeEquals (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); @@ -16388,120 +17212,7 @@ CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, Py #endif #endif -/* RaiseDoubleKeywords */ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); -} - -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; - PyObject *kwdefs; - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { - return NULL; - } - if ( - co->co_kwonlyargcount == 0 && - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); - kwdefs = PyFunction_GET_KW_DEFAULTS(func); - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif - -/* PyObjectCall */ +/* PyObjectCall (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; @@ -16521,7 +17232,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg } #endif -/* PyObjectCallMethO */ +/* PyObjectCallMethO (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; @@ -16541,7 +17252,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject } #endif -/* PyObjectFastCall */ +/* PyObjectFastCall (used by PyObjectCallOneArg) */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; @@ -16565,7 +17276,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * con #elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { PyTypeObject *tp = Py_TYPE(callable); - #if defined(__Pyx_CyFunction_USED) + #if defined(__Pyx_CyFunction_USED) && CYTHON_METH_FASTCALL if (__Pyx_CyFunction_CheckExact(callable)) { return __Pyx_CyFunction_func_vectorcall(callable); } @@ -16596,38 +17307,16 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return __Pyx_PyObject_CallMethO(func, args[0]); } #endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); - } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); - } - } - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); - } - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); - } - #endif - #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API - vectorcallfunc f = __Pyx_PyVectorcall_Function(func); - if (f) { - return f(func, args, _nargs, NULL); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, _nargs, NULL); - } - #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL - return PyObject_Vectorcall(func, args, _nargs, NULL); + #if CYTHON_VECTORCALL + #if CYTHON_COMPILING_IN_LIMITED_API + return PyObject_Vectorcall(func, args, _nargs, NULL); + #else + vectorcallfunc f = __Pyx_PyVectorcall_Function(func); + if (f) { + return f(func, args, _nargs, NULL); + } + #endif #endif } if (nargs == 0) { @@ -16640,7 +17329,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } -/* UnpackUnboundCMethod */ +/* PyObjectCallOneArg (used by CallUnboundCMethod0) */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *result; @@ -16725,6 +17420,121 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { return 0; } +/* CallUnboundCMethod0 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + if (likely(cfunc->flag == METH_NOARGS)) + return __Pyx_CallCFunction(cfunc, self, NULL); + if (likely(cfunc->flag == METH_FASTCALL)) + return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0); + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL); + if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS))) + return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (cfunc->flag == METH_VARARGS) + return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple); + return __Pyx__CallUnboundCMethod0(cfunc, self); + } +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + else if (unlikely(was_initialized == 1)) { + __Pyx_CachedCFunction tmp_cfunc = { +#ifndef __cplusplus + 0 +#endif + }; + tmp_cfunc.type = cfunc->type; + tmp_cfunc.method_name = cfunc->method_name; + return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self); + } +#endif + PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} +#endif +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *result; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; + result = __Pyx_PyObject_CallOneArg(cfunc->method, self); + return result; +} + +/* py_dict_items (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d); +} + +/* py_dict_values (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d); +} + +/* OwnedDictNext (used by ParseKeywordsImpl) */ +#if CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) { + PyObject *next = NULL; + if (!*ppos) { + if (pvalue) { + PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p); + if (unlikely(!dictview)) goto bad; + *ppos = PyObject_GetIter(dictview); + Py_DECREF(dictview); + } else { + *ppos = PyObject_GetIter(p); + } + if (unlikely(!*ppos)) goto bad; + } + next = PyIter_Next(*ppos); + if (!next) { + if (PyErr_Occurred()) goto bad; + return 0; + } + if (pkey && pvalue) { + *pkey = __Pyx_PySequence_ITEM(next, 0); + if (unlikely(*pkey)) goto bad; + *pvalue = __Pyx_PySequence_ITEM(next, 1); + if (unlikely(*pvalue)) goto bad; + Py_DECREF(next); + } else if (pkey) { + *pkey = next; + } else { + assert(pvalue); + *pvalue = next; + } + return 1; + bad: + Py_XDECREF(next); +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 + PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef"); +#else + PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef); +#endif + if (pkey) *pkey = NULL; + if (pvalue) *pvalue = NULL; + return 0; +} +#else // !CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) { + int result = PyDict_Next(p, ppos, pkey, pvalue); + if (likely(result == 1)) { + if (pkey) Py_INCREF(*pkey); + if (pvalue) Py_INCREF(*pvalue); + } + return result; +} +#endif + +/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); +} + /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { @@ -16779,7 +17589,7 @@ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObje } } -/* ParseKeywords */ +/* ParseKeywordsImpl (used by ParseKeywords) */ static int __Pyx_ValidateDuplicatePosArgs( PyObject *kwds, PyObject ** const argnames[], @@ -16935,16 +17745,23 @@ static void __Pyx_RejectUnknownKeyword( PyObject ** const *first_kw_arg, const char *function_name) { + #if CYTHON_AVOID_BORROWED_REFS + PyObject *pos = NULL; + #else Py_ssize_t pos = 0; + #endif PyObject *key = NULL; __Pyx_BEGIN_CRITICAL_SECTION(kwds); - while (PyDict_Next(kwds, &pos, &key, NULL)) { + while ( + #if CYTHON_AVOID_BORROWED_REFS + __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL) + #else + PyDict_Next(kwds, &pos, &key, NULL) + #endif + ) { PyObject** const *name = first_kw_arg; while (*name && (**name != key)) name++; if (!*name) { - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); - #endif size_t index_found = 0; int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); if (cmp != 1) { @@ -16958,12 +17775,15 @@ static void __Pyx_RejectUnknownKeyword( #endif break; } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(key); - #endif } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif } __Pyx_END_CRITICAL_SECTION(); + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(pos); + #endif assert(PyErr_Occurred()); } static int __Pyx_ParseKeywordDict( @@ -17135,6 +17955,8 @@ static int __Pyx_ParseKeywordsTuple( #endif return -1; } + +/* ParseKeywords */ static int __Pyx_ParseKeywords( PyObject *kwds, PyObject * const *kwvalues, @@ -17180,7 +18002,7 @@ static void __Pyx_RaiseArgtupleInvalid( (num_expected == 1) ? "" : "s", num_found); } -/* ArgTypeTest */ +/* ArgTypeTestFunc (used by ArgTypeTest) */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; @@ -17249,17 +18071,21 @@ static void __Pyx_RaiseClosureNameError(const char *varname) { /* UnicodeConcatInPlace */ # if CYTHON_COMPILING_IN_CPYTHON static int -__Pyx_unicode_modifiable(PyObject *unicode) +__Pyx_unicode_modifiable(PyObject *unicode, int unsafe_shared) { - if (Py_REFCNT(unicode) != 1) + if (!__Pyx_IS_UNIQUELY_REFERENCED(unicode, unsafe_shared)) + return 0; +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030F0000 + if (PyUnstable_Unicode_GET_CACHED_HASH(unicode) != -1) return 0; +#endif if (!PyUnicode_CheckExact(unicode)) return 0; if (PyUnicode_CHECK_INTERNED(unicode)) return 0; return 1; } -static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right, int unsafe_shared #if CYTHON_REFNANNY , void* __pyx_refnanny #endif @@ -17286,7 +18112,8 @@ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_le return NULL; } new_len = left_len + right_len; - if (__Pyx_unicode_modifiable(left) + if (left != right + && __Pyx_unicode_modifiable(left, unsafe_shared) && PyUnicode_CheckExact(right) && PyUnicode_KIND(right) <= PyUnicode_KIND(left) && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) { @@ -17310,7 +18137,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_le } #endif -/* PyDictVersioning */ +/* PyDictVersioning (used by GetModuleGlobalName) */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; @@ -17382,98 +18209,68 @@ static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; - long a, x; -#ifdef HAVE_LONG_LONG + long a; const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; -#endif + PY_LONG_LONG lla; if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } - if (likely(__Pyx_PyLong_IsCompact(op1))) { - a = __Pyx_PyLong_CompactValue(op1); + const int is_positive = __Pyx_PyLong_IsPos(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + if (likely(size == 1)) { + a = (long) digits[0]; + if (!is_positive) a *= -1; } else { - const digit* digits = __Pyx_PyLong_Digits(op1); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - 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])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; + break; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { 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])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - 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])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; + break; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { 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])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + break; } + return PyLong_Type.tp_as_number->nb_add(op1, op2); } + calculate_long: + { + long x; x = a + b; - return PyLong_FromLong(x); -#ifdef HAVE_LONG_LONG - long_long: + return PyLong_FromLong(x); + } + calculate_long_long: + { + PY_LONG_LONG llx; llx = lla + llb; - return PyLong_FromLongLong(llx); -#endif - return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); - + return PyLong_FromLongLong(llx); + } } #endif @@ -17511,98 +18308,68 @@ static PyObject* __Pyx_Unpacked___Pyx_PyLong_SubtractObjC(PyObject *op1, PyObjec CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; - long a, x; -#ifdef HAVE_LONG_LONG + long a; const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; -#endif + PY_LONG_LONG lla; if (unlikely(__Pyx_PyLong_IsZero(op1))) { return PyLong_FromLong(-intval); } - if (likely(__Pyx_PyLong_IsCompact(op1))) { - a = __Pyx_PyLong_CompactValue(op1); + const int is_positive = __Pyx_PyLong_IsPos(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + if (likely(size == 1)) { + a = (long) digits[0]; + if (!is_positive) a *= -1; } else { - const digit* digits = __Pyx_PyLong_Digits(op1); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - 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])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; + break; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { 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])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - 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])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; + break; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { 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])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2); + break; } + return PyLong_Type.tp_as_number->nb_subtract(op1, op2); } + calculate_long: + { + long x; x = a - b; - return PyLong_FromLong(x); -#ifdef HAVE_LONG_LONG - long_long: + return PyLong_FromLong(x); + } + calculate_long_long: + { + PY_LONG_LONG llx; llx = lla - llb; - return PyLong_FromLongLong(llx); -#endif - return __Pyx_Fallback___Pyx_PyLong_SubtractObjC(op1, op2, inplace); - + return PyLong_FromLongLong(llx); + } } #endif @@ -17638,70 +18405,110 @@ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { Py_DECREF(j); return r; } +static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) { + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); +} static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + int wraparound, int boundscheck, int unsafe_shared) { + CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); +#if CYTHON_AVOID_BORROWED_REFS + CYTHON_UNUSED_VAR(boundscheck); + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + Py_ssize_t size = __Pyx_PyList_GET_SIZE(o); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) return NULL; + #endif + wrapped_i += size; + } + return __Pyx_PyList_GetItemRef(o, wrapped_i); +#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS Py_ssize_t wrapped_i = i; + Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1; if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); + wrapped_i += size; } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) { + return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared); } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic_size(o, i); #else + (void)wraparound; + (void)boundscheck; return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS + int wraparound, int boundscheck, int unsafe_shared) { + CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); +#if CYTHON_AVOID_BORROWED_REFS + CYTHON_UNUSED_VAR(boundscheck); + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) return NULL; + #endif + wrapped_i += size; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API + return PySequence_ITEM(o, wrapped_i); + #else + if (unlikely(wrapped_i < 0)) { + PyErr_SetString(PyExc_IndexError, "tuple index out of range"); + return NULL; + } + return PySequence_GetItem(o, wrapped_i); + #endif +#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS Py_ssize_t wrapped_i = i; + Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1; if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); + wrapped_i += size; } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) { + return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i)); } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic_size(o, i); #else + (void)wraparound; + (void)boundscheck; return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + int wraparound, int boundscheck, int unsafe_shared) { + CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - return __Pyx_PyList_GetItemRef(o, n); - } - } - else if (PyTuple_CheckExact(o)) { + return boundscheck ? __Pyx_PyList_GetItemRef(o, n) : __Pyx_PyList_GET_ITEM_REF(o, n, unsafe_shared); + } else + #if !CYTHON_AVOID_BORROWED_REFS + if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; + return __Pyx_NewRef(PyTuple_GET_ITEM(o, n)); } - } else { + } else + #endif +#else + if ((!wraparound || i >= 0) & PyList_CheckExact(o)) { + return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared); + } else +#endif +#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY + { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_subscript) { + if (!is_list && mm && mm->mp_subscript) { PyObject *r, *key = PyLong_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } - if (likely(sm && sm->sq_item)) { + if (is_list || likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { @@ -17720,13 +18527,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return PySequence_GetItem(o, i); } #endif - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); -} - -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + (void)wraparound; + (void)boundscheck; + return __Pyx_GetItemInt_Generic_size(o, i); } /* ObjectGetItem */ @@ -17736,7 +18539,7 @@ static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { - return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index)); @@ -17750,6 +18553,11 @@ static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { + #if __PYX_LIMITED_VERSION_HEX >= 0x03090000 + if ((PyTypeObject*)obj == &PyType_Type) { + return Py_GenericAlias(obj, key); + } + #endif PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem); if (!meth) { PyErr_Clear(); @@ -17770,273 +18578,83 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyMappingMethods *mm = tp->tp_as_mapping; PySequenceMethods *sm = tp->tp_as_sequence; if (likely(mm && mm->mp_subscript)) { - return mm->mp_subscript(obj, key); - } - if (likely(sm && sm->sq_item)) { - return __Pyx_PyObject_GetIndex(obj, key); - } - return __Pyx_PyObject_GetItem_Slow(obj, key); -} -#endif - -/* SliceObject */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, - Py_ssize_t cstart, Py_ssize_t cstop, - PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, - int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { - __Pyx_TypeName obj_type_name; -#if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; - if (likely(mp && mp->mp_subscript)) -#endif - { - PyObject* result; - PyObject *py_slice, *py_start, *py_stop; - if (_py_slice) { - py_slice = *_py_slice; - } else { - PyObject* owned_start = NULL; - PyObject* owned_stop = NULL; - if (_py_start) { - py_start = *_py_start; - } else { - if (has_cstart) { - owned_start = py_start = PyLong_FromSsize_t(cstart); - if (unlikely(!py_start)) goto bad; - } else - py_start = Py_None; - } - if (_py_stop) { - py_stop = *_py_stop; - } else { - if (has_cstop) { - owned_stop = py_stop = PyLong_FromSsize_t(cstop); - if (unlikely(!py_stop)) { - Py_XDECREF(owned_start); - goto bad; - } - } else - py_stop = Py_None; - } - py_slice = PySlice_New(py_start, py_stop, Py_None); - Py_XDECREF(owned_start); - Py_XDECREF(owned_stop); - if (unlikely(!py_slice)) goto bad; - } -#if CYTHON_USE_TYPE_SLOTS - result = mp->mp_subscript(obj, py_slice); -#else - result = PyObject_GetItem(obj, py_slice); -#endif - if (!_py_slice) { - Py_DECREF(py_slice); - } - return result; - } - obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); -bad: - return NULL; -} - -/* RaiseException */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - if (cause) { - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if PY_VERSION_HEX >= 0x030C00A6 - PyException_SetTraceback(value, tb); -#elif CYTHON_FAST_THREAD_STATE - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#else - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#endif + return mm->mp_subscript(obj, key); } -bad: - Py_XDECREF(owned_instance); - return; -} - -/* GetTopmostException */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * -__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) -{ - _PyErr_StackItem *exc_info = tstate->exc_info; - while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && - exc_info->previous_item != NULL) - { - exc_info = exc_info->previous_item; + if (likely(sm && sm->sq_item)) { + return __Pyx_PyObject_GetIndex(obj, key); } - return exc_info; + return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif -/* SaveResetException */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - PyObject *exc_value = exc_info->exc_value; - if (exc_value == NULL || exc_value == Py_None) { - *value = NULL; - *type = NULL; - *tb = NULL; - } else { - *value = exc_value; - Py_INCREF(*value); - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - *tb = PyException_GetTraceback(exc_value); +/* SliceObject */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, + Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, + int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { + __Pyx_TypeName obj_type_name; +#if CYTHON_USE_TYPE_SLOTS + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; + if (likely(mp && mp->mp_subscript)) +#endif + { + PyObject* result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyLong_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyLong_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_USE_TYPE_SLOTS + result = mp->mp_subscript(obj, py_slice); +#else + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; } - #elif CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - *type = exc_info->exc_type; - *value = exc_info->exc_value; - *tb = exc_info->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #else - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #endif -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = tstate->exc_info; - PyObject *tmp_value = exc_info->exc_value; - exc_info->exc_value = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); - #else - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = type; - exc_info->exc_value = value; - exc_info->exc_traceback = tb; - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - #endif + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); +bad: + return NULL; } -#endif /* RaiseUnboundLocalError */ static void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } -/* GetException */ +/* GetException (used by pep479) */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else @@ -18057,12 +18675,12 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif -#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000 +#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000 local_value = PyErr_GetRaisedException(); #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif -#if __PYX_LIMITED_VERSION_HEX > 0x030C0000 +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); @@ -18080,7 +18698,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } -#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000 +#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000 Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); @@ -18127,7 +18745,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; -#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000 +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 bad: *type = 0; *value = 0; @@ -18167,6 +18785,7 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { } PyException_SetCause(new_exc, val); // steals ref to val PyErr_SetObject(PyExc_RuntimeError, new_exc); + Py_DECREF(new_exc); } /* DictGetItem */ @@ -18201,7 +18820,7 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { index, (index == 1) ? "" : "s"); } -/* PyObjectCall2Args */ +/* PyObjectCall2Args (used by CallUnboundCMethod1) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); @@ -18260,13 +18879,13 @@ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObje return result; } -/* PyObjectCallNoArg */ +/* PyObjectCallNoArg (used by pyfrozenset_new) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } -/* pyfrozenset_new */ +/* pyfrozenset_new (used by PySetContains) */ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { if (it) { PyObject* result; @@ -18399,8 +19018,8 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, CYTHON_UNUSED_VAR(max_char); CYTHON_UNUSED_VAR(result_ulength); for (i=0; i__pyx_empty_unicode, value_tuple); bad: @@ -18409,7 +19028,143 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, #endif } -/* LimitedApiGetTypeDict */ +/* py_dict_keys */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_keys, d); +} + +/* RaiseException */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { + PyObject* owned_instance = NULL; + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (PyExceptionClass_Check(type)) { + PyObject *instance_class = NULL; + if (value && PyExceptionInstance_Check(value)) { + instance_class = (PyObject*) Py_TYPE(value); + if (instance_class != type) { + int is_subclass = PyObject_IsSubclass(instance_class, type); + if (!is_subclass) { + instance_class = NULL; + } else if (unlikely(is_subclass == -1)) { + goto bad; + } else { + type = instance_class; + } + } + } + if (!instance_class) { + PyObject *args; + if (!value) + args = PyTuple_New(0); + else if (PyTuple_Check(value)) { + Py_INCREF(value); + args = value; + } else + args = PyTuple_Pack(1, value); + if (!args) + goto bad; + owned_instance = PyObject_Call(type, args, NULL); + Py_DECREF(args); + if (!owned_instance) + goto bad; + value = owned_instance; + if (!PyExceptionInstance_Check(value)) { + PyErr_Format(PyExc_TypeError, + "calling %R should have returned an instance of " + "BaseException, not %R", + type, Py_TYPE(value)); + goto bad; + } + } + } else { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + if (cause) { + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; + } else if (PyExceptionClass_Check(cause)) { + fixed_cause = PyObject_CallObject(cause, NULL); + if (fixed_cause == NULL) + goto bad; + } else if (PyExceptionInstance_Check(cause)) { + fixed_cause = cause; + Py_INCREF(fixed_cause); + } else { + PyErr_SetString(PyExc_TypeError, + "exception causes must derive from " + "BaseException"); + goto bad; + } + PyException_SetCause(value, fixed_cause); + } + PyErr_SetObject(type, value); + if (tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyException_SetTraceback(value, tb); +#elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} + +/* RaiseNoneIterError */ +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); +} + +/* dict_setdefault (used by FetchCommonType) */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) { + PyObject* value; +#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4) + PyDict_SetDefaultRef(d, key, default_value, &value); +#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + PyObject *args[] = {d, key, default_value}; + value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#elif CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL); +#else + value = PyDict_SetDefault(d, key, default_value); + if (unlikely(!value)) return NULL; + Py_INCREF(value); +#endif + return value; +} + +/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static Py_ssize_t __Pyx_GetTypeDictOffset(void) { PyObject *tp_dictoffset_o; @@ -18445,7 +19200,7 @@ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { } #endif -/* SetItemOnTypeDict */ +/* SetItemOnTypeDict (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { int result; PyObject *tp_dict; @@ -18467,7 +19222,7 @@ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) return result; } -/* FixUpExtensionType */ +/* FixUpExtensionType (used by FetchCommonType) */ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if __PYX_LIMITED_VERSION_HEX > 0x030900B1 CYTHON_UNUSED_VAR(spec); @@ -18502,14 +19257,11 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); -#if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; -#else - type->tp_print = (printfunc) memb->offset; -#endif changed = 1; } #endif // CYTHON_METH_FASTCALL +#if !CYTHON_COMPILING_IN_PYPY else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); @@ -18524,11 +19276,13 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject } changed = 1; } +#endif // !CYTHON_COMPILING_IN_PYPY } memb++; } } #endif // !CYTHON_COMPILING_IN_LIMITED_API +#if !CYTHON_COMPILING_IN_PYPY slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_getset) slot++; @@ -18560,35 +19314,66 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject ++getset; } } +#else + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); +#endif // !CYTHON_COMPILING_IN_PYPY if (changed) PyType_Modified(type); #endif // PY_VERSION_HEX > 0x030900B1 return 0; } -/* FetchSharedCythonModule */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); -} - -/* dict_setdefault */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, - int is_safe_type) { - PyObject* value; - CYTHON_MAYBE_UNUSED_VAR(is_safe_type); -#if CYTHON_COMPILING_IN_LIMITED_API - value = PyObject_CallMethod(d, "setdefault", "OO", key, default_value); -#elif PY_VERSION_HEX >= 0x030d0000 - PyDict_SetDefaultRef(d, key, default_value, &value); +/* AddModuleRef (used by FetchSharedCythonModule) */ +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) { + PyObject *module_dict = PyImport_GetModuleDict(); + PyObject *m; + if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) { + return NULL; + } + if (m != NULL && PyModule_Check(m)) { + return m; + } + Py_XDECREF(m); + m = PyModule_NewObject(name); + if (m == NULL) + return NULL; + if (PyDict_CheckExact(module_dict)) { + PyObject *new_m; + (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m); + Py_DECREF(m); + return new_m; + } else { + if (PyObject_SetItem(module_dict, name, m) != 0) { + Py_DECREF(m); + return NULL; + } + return m; + } + } + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *py_name = PyUnicode_FromString(name); + if (!py_name) return NULL; + PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name); + Py_DECREF(py_name); + return module; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else - value = PyDict_SetDefault(d, key, default_value); - if (unlikely(!value)) return NULL; - Py_INCREF(value); + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } #endif - return value; + +/* FetchSharedCythonModule (used by FetchCommonType) */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); } -/* FetchCommonType */ +/* FetchCommonType (used by CommonTypesMetaclass) */ #if __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases); @@ -18661,11 +19446,13 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyOb } else if (unlikely(get_item_ref_result == -1)) { goto bad; } - CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromMetaclass(metaclass, abi_module, spec, bases); + cached_type = __Pyx_PyType_FromMetaclass( + metaclass, + CYTHON_USE_MODULE_STATE ? module : abi_module, + spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; - new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1); + new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type); if (unlikely(new_cached_type != cached_type)) { if (unlikely(!new_cached_type)) goto bad; Py_DECREF(cached_type); @@ -18691,26 +19478,39 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyOb goto done; } -/* CommonTypesMetaclass */ -PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { +/* CommonTypesMetaclass (used by CythonFunctionShared) */ +static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); } +#if __PYX_LIMITED_VERSION_HEX < 0x030A0000 +static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) { + PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types"); + return NULL; +} +static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) { + PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable"); + return -1; +} +#endif static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = { {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL}, {0, 0, 0, 0, 0} }; static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = { {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset}, + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call}, + {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call}, + {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr}, + #endif {0, 0} }; static PyType_Spec __pyx_CommonTypesMetaclass_spec = { __PYX_TYPE_MODULE_PREFIX "_common_types_metatype", 0, 0, -#if PY_VERSION_HEX >= 0x030A0000 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | -#endif Py_TPFLAGS_DEFAULT, __pyx_CommonTypesMetaclass_slots }; @@ -18721,13 +19521,14 @@ static int __pyx_CommonTypesMetaclass_init(PyObject *module) { return -1; } mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); + Py_DECREF(bases); if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { return -1; } return 0; } -/* CallTypeTraverse */ +/* CallTypeTraverse (used by CythonFunctionShared) */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) { @@ -18746,7 +19547,7 @@ static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visi } #endif -/* PyMethodNew */ +/* PyMethodNew (used by CythonFunctionShared) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *result; @@ -18772,15 +19573,20 @@ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *ty } #endif -/* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +/* PyVectorcallFastCallDict (used by CythonFunctionShared) */ +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; - Py_ssize_t i, pos; + Py_ssize_t i; + #if CYTHON_AVOID_BORROWED_REFS + PyObject *pos; + #else + Py_ssize_t pos; + #endif size_t j; PyObject *key, *value; unsigned long keys_are_strings; @@ -18802,17 +19608,16 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector return NULL; } kwvalues = newargs + nargs; - pos = i = 0; + pos = 0; + i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; - while (PyDict_Next(kw, &pos, &key, &value)) { + while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) { keys_are_strings &= #if CYTHON_COMPILING_IN_LIMITED_API PyType_GetFlags(Py_TYPE(key)); #else Py_TYPE(key)->tp_flags; #endif - Py_INCREF(key); - Py_INCREF(value); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; #else @@ -18827,6 +19632,9 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } res = vc(func, newargs, nargs, kwnames); cleanup: + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(pos); + #endif Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); @@ -18855,7 +19663,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ } #endif -/* CythonFunctionShared */ +/* CythonFunctionShared (used by CythonFunction) */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { if (__Pyx_CyFunction_Check(func)) { @@ -19007,9 +19815,11 @@ __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void __Pyx_END_CRITICAL_SECTION(); return 0; } +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject * -__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) @@ -19018,36 +19828,7 @@ __Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) Py_INCREF(op->func_dict); return op->func_dict; } -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - PyObject *result; - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_dict_locked(op); - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - Py_INCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->func_dict, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; -} +#endif static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { @@ -19175,6 +19956,7 @@ __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { __Pyx_END_CRITICAL_SECTION(); return result; } +static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value); static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -19189,8 +19971,54 @@ __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, vo __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_annotations, value); __Pyx_END_CRITICAL_SECTION(); + if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists((PyObject*) op, Py_None) < 0)) return -1; return 0; } +static int +__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) { + /* Return 1 if the function dict exists, 0 otherwise. This cannot fail: + * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */ +#if CYTHON_COMPILING_IN_PYPY + *dict = PyObject_GenericGetDict(op_in, NULL); +#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000 + *dict = ((__pyx_CyFunctionObject*) op_in)->func_dict; +#else + PyObject **dictptr = _PyObject_GetDictPtr(op_in); + *dict = likely(dictptr) ? *dictptr : NULL; +#endif + return *dict ? 1 : 0; +} +static int +__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) { + PyObject *dict; + int dict_found; + *annotate = NULL; + dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict); + if (!dict_found) return 0; + return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate); +} +static int +__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) { + PyObject *dict; + int dict_found; + dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict); + if (!dict_found) return 0; + return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value); +} +static int +__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) { + PyObject *dict; + int result; +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + dict = __Pyx_CyFunction_get_dict((__pyx_CyFunctionObject*) op_in, NULL); +#else + dict = PyObject_GenericGetDict(op_in, NULL); +#endif + if (unlikely(!dict)) return -1; + result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value); + Py_DECREF(dict); + return result; +} static PyObject * __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; @@ -19203,14 +20031,88 @@ __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { return result; } static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { - PyObject *result; +__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) { + PyObject *annotate = NULL; + PyObject *result = NULL; + __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in; CYTHON_UNUSED_VAR(context); - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + result = __Pyx_XNewRef(op->func_annotations); + __Pyx_END_CRITICAL_SECTION(); + if (result) return result; + if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL; + if (!annotate || annotate == Py_None) { + Py_XDECREF(annotate); + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; + } + PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE + if (likely(format)) { + result = __Pyx_PyObject_CallOneArg(annotate, format); + Py_DECREF(format); + } + Py_DECREF(annotate); + if (unlikely(!result)) return NULL; + if (unlikely(!PyDict_Check(result))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict"); + Py_DECREF(result); + return NULL; + } + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result)); __Pyx_END_CRITICAL_SECTION(); return result; } +static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *args) { + CYTHON_UNUSED_VAR(args); + if (unlikely(!self)) { + PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument"); + } + Py_XINCREF(self); + return self; +} +static PyMethodDef __Pyx_CyFunction_annotate_method = { + "__annotate__", + (PyCFunction)(void (*)(void))__Pyx_CyFunction_annotate_impl, + METH_VARARGS, + "Placeholder __annotate__ function to allow 'functools.wraps' to work " + "on Cython functions." +}; +static PyObject * +__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) { + PyObject *annotate = NULL; + CYTHON_UNUSED_VAR(context); + if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL; + if (annotate) return annotate; + PyObject *annotations = __Pyx_CyFunction_get_annotations(op_in, NULL); + if (unlikely(!annotations)) return NULL; + PyObject *method = PyCFunction_New( + &__Pyx_CyFunction_annotate_method, + annotations); + Py_DECREF(annotations); + return method; +} +static int +__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted"); + return -1; + } + if (unlikely(value != Py_None && !PyCallable_Check(value))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None"); + return -1; + } + if (value != Py_None) { + __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in; + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + Py_CLEAR(op->func_annotations); + __Pyx_END_CRITICAL_SECTION(); + } + return __Pyx_CyFunction_set_annotate_in_dict(op_in, value); +} static PyObject * __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; @@ -19223,7 +20125,6 @@ __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { - Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } @@ -19309,8 +20210,13 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, + {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, +#else + {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, + {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, +#endif {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, @@ -19321,6 +20227,7 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0}, {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, @@ -19331,9 +20238,11 @@ static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#endif #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, @@ -19389,7 +20298,9 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_XINCREF(module); cf->m_module = module; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API op->func_dict = NULL; +#endif op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; @@ -19443,14 +20354,19 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func_dict); +#elif PY_VERSION_HEX < 0x030d0000 + _PyObject_ClearManagedDict((PyObject*)m); +#else + PyObject_ClearManagedDict((PyObject*)m); +#endif Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { @@ -19458,7 +20374,6 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } -#endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); @@ -19491,17 +20406,29 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func_dict); +#else + { + int e = +#if PY_VERSION_HEX < 0x030d0000 + _PyObject_VisitManagedDict +#else + PyObject_VisitManagedDict +#endif + ((PyObject*)m, visit, arg); + if (e != 0) return e; + } +#endif __Pyx_VISIT_CONST(m->func_name); __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); __Pyx_VISIT_CONST(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); -#endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_annotations); Py_VISIT(m->func_is_coroutine); Py_VISIT(m->defaults); return 0; @@ -19603,7 +20530,7 @@ static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *a static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE @@ -19642,7 +20569,7 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; @@ -19664,11 +20591,7 @@ static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionO static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -19703,11 +20626,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -19742,11 +20661,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -19777,11 +20692,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -19806,7 +20717,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); + #if PY_VERSION_HEX < 0x030e00A6 + size_t nargs_value = (size_t) nargs; + #else + Py_ssize_t nargs_value = nargs; + #endif + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames); } #endif static PyType_Slot __pyx_CyFunctionType_slots[] = { @@ -19835,9 +20751,10 @@ static PyType_Spec __pyx_CyFunctionType_spec = { _Py_TPFLAGS_HAVE_VECTORCALL | #endif #endif // CYTHON_METH_FASTCALL -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | +#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_TPFLAGS_MANAGED_DICT | #endif + Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; @@ -19897,11 +20814,6 @@ __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) return 0; } -/* RaiseNoneIterError */ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; @@ -19927,7 +20839,7 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { return __Pyx_IterFinish(); } -/* GetAttr */ +/* GetAttr (used by Globals) */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS if (likely(PyUnicode_Check(n))) @@ -19936,12 +20848,117 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { return PyObject_GetAttr(o, n); } -/* Globals */ -static PyObject* __Pyx_Globals(void) { - return __Pyx_NewRef(__pyx_mstate_global->__pyx_d); +/* Globals */ +static PyObject* __Pyx_Globals(void) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_d); +} + +/* GetTopmostException (used by SaveResetException) */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + PyObject *exc_value = exc_info->exc_value; + if (exc_value == NULL || exc_value == Py_None) { + *value = NULL; + *type = NULL; + *tb = NULL; + } else { + *value = exc_value; + Py_INCREF(*value); + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + *tb = PyException_GetTraceback(exc_value); + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #endif +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + PyObject *tmp_value = exc_info->exc_value; + exc_info->exc_value = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); + #else + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); + #endif +} +#endif + +/* AllocateExtensionType */ +static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) { + if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc); + return alloc_func(t, 0); + } else { + newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc); + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (!tp_new) { + PyObject *new_str = PyUnicode_FromString("__new__"); + if (likely(new_str)) { + PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL); + Py_DECREF(new_str); + return o; + } else + return NULL; + } else + #endif + return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0); + } } -/* PyObjectGetMethod */ +/* PyObjectGetMethod (used by PyObjectCallMethod0) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP @@ -20030,9 +21047,16 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me *method = attr; return 0; } +#endif -/* PyObjectCallMethod0 */ +/* PyObjectCallMethod0 (used by PyType_Ready) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { +#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) + PyObject *args[1] = {obj}; + (void) __Pyx_PyObject_CallOneArg; + (void) __Pyx_PyObject_CallNoArg; + return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#else PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { @@ -20045,9 +21069,10 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name Py_DECREF(method); bad: return result; +#endif } -/* ValidateBasesTuple */ +/* ValidateBasesTuple (used by PyType_Ready) */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; @@ -20217,19 +21242,121 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #endif } -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { +/* HasAttr (used by ImportImpl) */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!PyUnicode_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_PyObject_GetAttrStrNoError(o, n); + if (!r) { + return (unlikely(PyErr_Occurred())) ? -1 : 0; + } else { + Py_DECREF(r); + return 1; + } +} +#endif + +/* ImportImpl (used by Import) */ +static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) { + PyObject *imported_module = PyImport_GetModule(qualname); + if (unlikely(!imported_module)) { + *module = NULL; + if (PyErr_Occurred()) { + return -1; + } + return 0; + } + *module = imported_module; + return 1; +} +static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) { + PyObject *imported_module; + PyObject *top_level_package_name; + Py_ssize_t i; + int status, module_found; + Py_ssize_t dot_index; + module_found = __Pyx__Import_GetModule(qualname, &imported_module); + if (unlikely(!module_found || module_found == -1)) { + *module = NULL; + return module_found; + } + if (imported_names) { + for (i = 0; i < len_imported_names; i++) { + PyObject *imported_name = imported_names[i]; +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 + int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name); +#else + int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name); + if (unlikely(has_imported_attribute == -1)) goto error; +#endif + if (!has_imported_attribute) { + goto not_found; + } + } + *module = imported_module; + return 1; + } + dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1); + if (dot_index == -1) { + *module = imported_module; + return 1; + } + if (unlikely(dot_index == -2)) goto error; + top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index); + if (unlikely(!top_level_package_name)) goto error; + Py_DECREF(imported_module); + status = __Pyx__Import_GetModule(top_level_package_name, module); + Py_DECREF(top_level_package_name); + return status; +error: + Py_DECREF(imported_module); + *module = NULL; + return -1; +not_found: + Py_DECREF(imported_module); + *module = NULL; + return 0; +} +static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) { PyObject *module = 0; PyObject *empty_dict = 0; - PyObject *empty_list = 0; + PyObject *from_list = 0; + int module_found; + if (!qualname) { + qualname = name; + } + module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module); + if (likely(module_found == 1)) { + return module; + } else if (unlikely(module_found == -1)) { + return NULL; + } empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; + if (imported_names) { +#if CYTHON_COMPILING_IN_CPYTHON + from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names); + if (unlikely(!from_list)) + goto bad; +#else + from_list = PyList_New(len_imported_names); + if (unlikely(!from_list)) goto bad; + for (Py_ssize_t i=0; i__pyx_d, empty_dict, from_list, 1); + name, moddict, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; @@ -20240,145 +21367,17 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { } if (!module) { module = PyImport_ImportModuleLevelObject( - name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); + name, moddict, empty_dict, from_list, level); } bad: + Py_XDECREF(from_list); Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); - return module; -} - -/* ImportDottedModule */ -static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { - PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; - Py_ssize_t size; - if (unlikely(PyErr_Occurred())) { - PyErr_Clear(); - } -#if CYTHON_ASSUME_SAFE_SIZE - size = PyTuple_GET_SIZE(parts_tuple); -#else - size = PyTuple_Size(parts_tuple); - if (size < 0) goto bad; -#endif - if (likely(size == count)) { - partial_name = name; - } else { - slice = PySequence_GetSlice(parts_tuple, 0, count); - if (unlikely(!slice)) - goto bad; - sep = PyUnicode_FromStringAndSize(".", 1); - if (unlikely(!sep)) - goto bad; - partial_name = PyUnicode_Join(sep, slice); - } - PyErr_Format( - PyExc_ModuleNotFoundError, - "No module named '%U'", partial_name); -bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; -} -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { - PyObject *imported_module; -#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ - CYTHON_COMPILING_IN_GRAAL - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - return NULL; - imported_module = __Pyx_PyDict_GetItemStr(modules, name); - Py_XINCREF(imported_module); -#else - imported_module = PyImport_GetModule(name); -#endif - return imported_module; -} -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { - Py_ssize_t i, nparts; -#if CYTHON_ASSUME_SAFE_SIZE - nparts = PyTuple_GET_SIZE(parts_tuple); -#else - nparts = PyTuple_Size(parts_tuple); - if (nparts < 0) return NULL; -#endif - for (i=1; i < nparts && module; i++) { - PyObject *part, *submodule; -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - part = PyTuple_GET_ITEM(parts_tuple, i); -#else - part = __Pyx_PySequence_ITEM(parts_tuple, i); - if (!part) return NULL; -#endif - submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(part); -#endif - Py_DECREF(module); - module = submodule; - } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); - } return module; } -static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) - return module; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; - } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -} -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec); - if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_initializing); - if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { - Py_DECREF(spec); - spec = NULL; - } - Py_XDECREF(unsafe); - } - if (likely(!spec)) { - PyErr_Clear(); - return module; - } - Py_DECREF(spec); - Py_DECREF(module); - } else if (PyErr_Occurred()) { - PyErr_Clear(); - } -#endif - return __Pyx__ImportDottedModule(name, parts_tuple); -} -/* ListPack */ -static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { - va_list va; - PyObject *l = PyList_New(n); - va_start(va, n); - if (unlikely(!l)) goto end; - for (Py_ssize_t i=0; i__pyx_d, level); } /* ImportFrom */ @@ -20420,55 +21419,44 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { return value; } -/* CLineInTraceback */ +/* CLineInTraceback (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o)) +#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL); +#else +PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) { + PyObject **dict_ptr = _PyObject_GetDictPtr(o); + return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL; +} +#endif static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { - PyObject *use_cline; + PyObject *use_cline = NULL; PyObject *ptype, *pvalue, *ptraceback; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject **cython_runtime_dict; -#endif + PyObject *cython_runtime_dict; CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); -#if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); + cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { - __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict); __PYX_PY_DICT_LOOKUP_IF_MODIFIED( - use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) - Py_XINCREF(use_cline); - __Pyx_END_CRITICAL_SECTION(); - } else -#endif - { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); - if (use_cline_obj) { - use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; - Py_INCREF(use_cline); - Py_DECREF(use_cline_obj); - } else { - PyErr_Clear(); - use_cline = NULL; - } + use_cline, cython_runtime_dict, + __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False)) } - if (!use_cline) { - c_line = 0; - (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); - } - else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } Py_XDECREF(use_cline); + Py_XDECREF(cython_runtime_dict); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif -/* CodeObjectCache */ +/* CodeObjectCache (used by AddTraceback) */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -20620,8 +21608,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { - (void) __pyx_cfilenm; - (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = __pyx_find_code_object(c_line ? -c_line : py_line); @@ -20630,7 +21617,11 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); + if (c_line) { + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + } else { + py_funcname = PyUnicode_FromString(funcname); + } if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; @@ -20722,12 +21713,12 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } #endif -/* PyObjectVectorCallKwBuilder */ +/* PyObjectVectorCallKwBuilder (used by CIntToPy) */ #if CYTHON_VECTORCALL static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { (void)__Pyx_PyObject_FastCallDict; - if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; Py_INCREF(key); + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; args[n] = value; return 0; } @@ -20770,7 +21761,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif @@ -20778,10 +21769,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { } else { if (sizeof(long) <= sizeof(long)) { return PyLong_FromLong((long) value); -#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif } } { @@ -20864,7 +21853,7 @@ __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) } #endif -/* CIntFromPyVerify */ +/* CIntFromPyVerify (used by CIntFromPy) */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ @@ -20960,10 +21949,8 @@ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -21032,10 +22019,8 @@ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif } } { @@ -21214,10 +22199,8 @@ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -21286,10 +22269,8 @@ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif } } { @@ -21481,7 +22462,40 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj } #endif -/* SwapException */ +/* GetRuntimeVersion */ +#if __PYX_LIMITED_VERSION_HEX < 0x030b0000 +void __Pyx_init_runtime_version(void) { + if (__Pyx_cached_runtime_version == 0) { + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + __Pyx_cached_runtime_version = version; + } +} +#endif +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + return Py_Version & ~0xFFUL; +#else + return __Pyx_cached_runtime_version; +#endif +} + +/* SwapException (used by CoroutineBase) */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; @@ -21535,7 +22549,7 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, } #endif -/* IterNextPlain */ +/* IterNextPlain (used by CoroutineBase) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) { if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache)) @@ -21558,8 +22572,8 @@ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { #endif } -/* PyObjectCallMethod1 */ -#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) +/* PyObjectCallMethod1 (used by CoroutineBase) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); @@ -21567,9 +22581,8 @@ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { -#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 +#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) PyObject *args[2] = {obj, arg}; - (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); @@ -21586,7 +22599,7 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name #endif } -/* ReturnWithStopIteration */ +/* ReturnWithStopIteration (used by CoroutineBase) */ static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) { if (value == Py_None) { @@ -21640,7 +22653,7 @@ static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { Py_DECREF(exc); } -/* CoroutineBase */ +/* CoroutineBase (used by Generator) */ #if !CYTHON_COMPILING_IN_LIMITED_API #include #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) @@ -22251,7 +23264,8 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject ret = __Pyx_PyObject_Call(meth, args, NULL); } else { PyObject *cargs[4] = {NULL, typ, val, tb}; - ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + size_t nargs = 1U + (val != NULL) + (tb != NULL); + ret = __Pyx_PyObject_FastCall(meth, cargs+1, nargs | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } Py_DECREF(meth); } @@ -22323,7 +23337,9 @@ static int __Pyx_Coroutine_clear(PyObject *self) { static void __Pyx_Coroutine_dealloc(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject_GC_UnTrack(gen); + #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API if (gen->gi_weakreflist != NULL) + #endif PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); @@ -22446,14 +23462,10 @@ __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void __Pyx_Py_XDECREF_SET(self->gi_qualname, value); return 0; } -static PyObject * -__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) -{ #if !CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx__Coroutine_get_frame_locked(__pyx_CoroutineObject *self) { PyObject *frame; - #if PY_VERSION_HEX >= 0x030d0000 - Py_BEGIN_CRITICAL_SECTION(self); - #endif frame = self->gi_frame; if (!frame) { if (unlikely(!self->gi_code)) { @@ -22478,9 +23490,17 @@ __Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) } } Py_INCREF(frame); - #if PY_VERSION_HEX >= 0x030d0000 - Py_END_CRITICAL_SECTION(); - #endif + return frame; +} +#endif +static PyObject * +__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) +{ +#if !CYTHON_COMPILING_IN_LIMITED_API + PyObject *frame; + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)self); + frame = __Pyx__Coroutine_get_frame_locked(self); + __Pyx_END_CRITICAL_SECTION(); return frame; #else CYTHON_UNUSED_VAR(self); @@ -22524,7 +23544,9 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( #if CYTHON_USE_EXC_INFO_STACK gen->gi_exc_state.previous_item = NULL; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API gen->gi_weakreflist = NULL; +#endif Py_XINCREF(qualname); gen->gi_qualname = qualname; Py_XINCREF(name); @@ -22534,40 +23556,32 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( Py_XINCREF(code); gen->gi_code = code; gen->gi_frame = NULL; +#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) + memset(gen->__pyx_pymonitoring_state, 0, sizeof(gen->__pyx_pymonitoring_state)); + gen->__pyx_pymonitoring_version = 0; +#endif PyObject_GC_Track(gen); return gen; } static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) { char result; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen); result = gen->is_running; gen->is_running = 1; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif + __Pyx_END_CRITICAL_SECTION(); return result; } static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) { - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen); assert(gen->is_running); gen->is_running = 0; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif + __Pyx_END_CRITICAL_SECTION(); } static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) { char result; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen); result = gen->is_running; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif + __Pyx_END_CRITICAL_SECTION(); return result; } static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) { @@ -22613,7 +23627,9 @@ static PyMemberDef __pyx_Generator_memberlist[] = { PyDoc_STR("object being iterated by 'yield from', or None")}, {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, +#endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { @@ -22647,10 +23663,11 @@ static PyType_Spec __pyx_GeneratorType_spec = { __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | +#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_TPFLAGS_MANAGED_WEAKREF | #endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, + Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND, __pyx_GeneratorType_slots }; #if __PYX_HAS_PY_AM_SEND == 2 @@ -22682,36 +23699,6 @@ static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { return retval; } -/* GetRuntimeVersion */ -static unsigned long __Pyx_get_runtime_version(void) { -#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 - return Py_Version & ~0xFFUL; -#else - static unsigned long __Pyx_cached_runtime_version = 0; - if (__Pyx_cached_runtime_version == 0) { - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); - ++i; - } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; - } - __Pyx_cached_runtime_version = version; - } - return __Pyx_cached_runtime_version; -#endif -} - /* CheckBinaryVersion */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; @@ -22795,9 +23782,13 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1 + if (likely(result)) + result->_co_firsttraceable = 0; + #endif return result; } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY +#elif !CYTHON_COMPILING_IN_PYPY #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else @@ -22809,10 +23800,10 @@ static PyObject* __Pyx_PyCode_New( PyObject * const *varnames, PyObject *filename, PyObject *funcname, - const char *line_table, + PyObject *line_table, PyObject *tuple_dedup_map ) { - PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL; + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL; Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; PyObject *varnames_tuple = PyTuple_New(var_count); if (unlikely(!varnames_tuple)) return NULL; @@ -22833,11 +23824,12 @@ static PyObject* __Pyx_PyCode_New( #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(varnames_tuple_dedup); #endif - if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL - && !CYTHON_COMPILING_IN_GRAAL) { - line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length); - if (unlikely(!line_table_bytes)) goto done; - Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3; + if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) { + Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(line_table_length == -1)) goto done; + #endif + Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL; code_bytes = PyBytes_FromStringAndSize(NULL, code_len); if (unlikely(!code_bytes)) goto done; char* c_code_bytes = PyBytes_AsString(code_bytes); @@ -22860,11 +23852,10 @@ static PyObject* __Pyx_PyCode_New( filename, funcname, (int) descr.first_line, - (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes ); done: Py_XDECREF(code_bytes); - Py_XDECREF(line_table_bytes); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(varnames_tuple_dedup); #endif @@ -22872,30 +23863,68 @@ static PyObject* __Pyx_PyCode_New( return code_obj; } -/* InitStrings */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { - while (t->s) { - PyObject *str; - if (t->is_unicode) { - if (t->intern) { - str = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); - } else { - str = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - str = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - if (!str) - return -1; - *target = str; - if (PyObject_Hash(str) == -1) - return -1; - ++t; - ++target; +/* DecompressString */ +static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) { + PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed; + const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib"; + PyObject *methodname = PyUnicode_FromString("decompress"); + if (unlikely(!methodname)) return NULL; + #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000 + if (algo == 3) { + PyObject *fromlist = Py_BuildValue("[O]", methodname); + if (unlikely(!fromlist)) goto bad; + module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + } else + #endif + module = PyImport_ImportModule(module_name); + if (unlikely(!module)) goto import_failed; + decompress = PyObject_GetAttr(module, methodname); + if (unlikely(!decompress)) goto import_failed; + { + #ifdef __cplusplus + char *memview_bytes = const_cast(s); + #else + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wcast-qual" + #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-qual" + #endif + char *memview_bytes = (char*) s; + #if defined(__clang__) + #pragma clang diagnostic pop + #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) + #pragma GCC diagnostic pop + #endif + #endif + #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ) + int memview_flags = 0x100; + #else + int memview_flags = PyBUF_READ; + #endif + compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags); } - return 0; + if (unlikely(!compressed_bytes)) { + Py_DECREF(decompress); + goto bad; + } + decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL); + Py_DECREF(compressed_bytes); + Py_DECREF(decompress); + Py_DECREF(module); + Py_DECREF(methodname); + return decompressed; +import_failed: + PyErr_Format(PyExc_ImportError, + "Failed to import '%.20s.decompress' - cannot initialise module strings. " + "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.", + module_name, algo); +bad: + Py_XDECREF(module); + Py_DECREF(methodname); + return NULL; } #include @@ -23117,7 +24146,7 @@ static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { return __Pyx_NewRef(Py_None); } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { - return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); + return __Pyx_NewRef(b ? Py_True: Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { return PyLong_FromSize_t(ival); diff --git a/constraint/parser.py b/constraint/parser.py index af7b0a8..d2ea965 100644 --- a/constraint/parser.py +++ b/constraint/parser.py @@ -1,34 +1,36 @@ """Module containing the code for parsing string constraints.""" + import re from types import FunctionType -from typing import Union, Optional + from constraint.constraints import ( AllDifferentConstraint, AllEqualConstraint, + CompilableFunctionConstraint, Constraint, + ExactProdConstraint, ExactSumConstraint, - MinSumConstraint, + FunctionConstraint, + MaxProdConstraint, MaxSumConstraint, - ExactProdConstraint, MinProdConstraint, - MaxProdConstraint, - FunctionConstraint, - CompilableFunctionConstraint, - VariableExactSumConstraint, - VariableMinSumConstraint, - VariableMaxSumConstraint, + MinSumConstraint, VariableExactProdConstraint, - VariableMinProdConstraint, + VariableExactSumConstraint, VariableMaxProdConstraint, # TODO implement parsing for these constraints: # InSetConstraint, # NotInSetConstraint, # SomeInSetConstraint, # SomeNotInSetConstraint, + VariableMaxSumConstraint, + VariableMinProdConstraint, + VariableMinSumConstraint, ) -def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: - """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 + +def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Constraint | str, list[str]]]: + """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 # rewrite the restrictions so variables are singled out regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" regex_match_variable_or_constant = r"([a-zA-Z_$0-9]*)" @@ -76,9 +78,7 @@ def to_multiple_restrictions(restrictions: list[str]) -> list[str]: split_restrictions.append(temp_copy[prev_stop:next_stop].strip()) return split_restrictions - def to_numeric_constraint( - restriction: str, params: list[str] - ) -> Optional[Union[MinSumConstraint, VariableMinSumConstraint, ExactSumConstraint, VariableExactSumConstraint, MaxSumConstraint, VariableMaxSumConstraint, MinProdConstraint, VariableMinProdConstraint, ExactProdConstraint, VariableExactProdConstraint, MaxProdConstraint, VariableMaxProdConstraint]]: # noqa: E501 + def to_numeric_constraint(restriction: str, params: list[str]) -> MinSumConstraint | VariableMinSumConstraint | ExactSumConstraint | VariableExactSumConstraint | MaxSumConstraint | VariableMaxSumConstraint | MinProdConstraint | VariableMinProdConstraint | ExactProdConstraint | VariableExactProdConstraint | MaxProdConstraint | VariableMaxProdConstraint | None: # noqa: E501 """Converts a restriction to a built-in numeric constraint if possible.""" # first check if all parameters have only numbers as values if len(params) == 0 or not all(all(isinstance(v, (int, float)) for v in tune_params[p]) for p in params): @@ -95,10 +95,8 @@ def to_numeric_constraint( left, right = tuple(s.strip() for s in restriction.split(comparator)) # if we have an inverse operation, rewrite to the other side - supported_operators = ["**", "*", "+", "-", "/"] - operators_left = [s.strip() for s in list(left) if s in supported_operators] - operators_right = [s.strip() for s in list(right) if s in supported_operators] - # TODO implement the case where the minus is part of a constant, e.g. "-3 <= x + y" + operators_left = extract_operators(left) + operators_right = extract_operators(right) if len(operators_left) > 0 and len(operators_right) > 0: # if there are operators on both sides, we can't handle this yet return None @@ -107,7 +105,9 @@ def to_numeric_constraint( unique_operators = unique_operators_left.union(unique_operators_right) if len(unique_operators) == 1: variables_on_left = len(unique_operators_left) > 0 - swapped_side_first_component = re.search(regex_match_variable_or_constant, left if variables_on_left else right) # noqa: E501 + swapped_side_first_component = re.search( + regex_match_variable_or_constant, left if variables_on_left else right + ) # noqa: E501 if swapped_side_first_component is None: # if there is no variable on the left side, we can't handle this yet return None @@ -116,79 +116,108 @@ def to_numeric_constraint( if "-" in unique_operators: if not variables_on_left: # e.g. "G == B-M" becomes "G+M == B" - right_remainder = right[len(swapped_side_first_component):] + right_remainder = right[len(swapped_side_first_component) :] left_swap = right_remainder.replace("-", "+") restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" else: # e.g. "B-M == G" becomes "B == G+M" - left_remainder = left[len(swapped_side_first_component):] + left_remainder = left[len(swapped_side_first_component) :] right_swap = left_remainder.replace("-", "+") restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" if "/" in unique_operators: if not variables_on_left: # e.g. "G == B/M" becomes "G*M == B" - right_remainder = right[len(swapped_side_first_component):] + right_remainder = right[len(swapped_side_first_component) :] left_swap = right_remainder.replace("/", "*") restriction = f"{left}{left_swap}{comparator}{swapped_side_first_component}" else: # e.g. "B/M == G" becomes "B == G*M" - left_remainder = left[len(swapped_side_first_component):] + left_remainder = left[len(swapped_side_first_component) :] right_swap = left_remainder.replace("/", "*") restriction = f"{swapped_side_first_component}{comparator}{right}{right_swap}" # we have a potentially rewritten restriction, split again left, right = tuple(s.strip() for s in restriction.split(comparator)) - operators_left = [s.strip() for s in list(left) if s in supported_operators] - operators_right = [s.strip() for s in list(right) if s in supported_operators] + operators_left = extract_operators(left) + operators_right = extract_operators(right) unique_operators_left = set(operators_left) unique_operators_right = set(operators_right) unique_operators = unique_operators_left.union(unique_operators_right) # find out which side is the constant number - def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: - try: - # check if it's a number or solvable to a number (e.g. '32*2') - number = eval(s) - assert isinstance(number, (int, float)) - return number - except Exception: - # it's not a solvable subexpression, return None - return None - # either the left or right side of the equation must evaluate to a constant number, otherwise we use a VariableConstraint # noqa: E501 left_num = is_or_evals_to_number(left) right_num = is_or_evals_to_number(right) if (left_num is None and right_num is None) or (left_num is not None and right_num is not None): # if both sides are parameters, try to use the VariableConstraints - variable_supported_operators = ['+', '*'] + variable_supported_operators = ["+", "*"] # variables = [s.strip() for s in list(left + right) if s not in variable_supported_operators] variables = re.findall(regex_match_variable, restriction) + # if the restriction contains more than the variables and supported operators, return None + if len(variables) == 0: + return None + if any(var.strip() not in tune_params for var in variables): + raise ValueError(f"Variables {variables} not in tune_params {tune_params.keys()}") + if ( + len(re.findall(r"[+-]?\d+", restriction)) > 0 + ): # TODO adjust when we support modifiers such as multipliers (see roadmap) # noqa: E501 + # if the restriction contains numbers, return None + return None + # find all unique variable_supported_operators in the restriction, can have at most one variable_operators_left = list(s.strip() for s in list(left) if s in variable_supported_operators) variable_operators_right = list(s.strip() for s in list(right) if s in variable_supported_operators) variable_unique_operators = list(set(variable_operators_left).union(set(variable_operators_right))) # if there is a mix of operators (e.g. 'x + y * z == a') or multiple variables on both sides, return None - if len(variable_unique_operators) <= 1 and all(s.strip() in params for s in variables) and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0): # noqa: E501 + if ( + len(variable_unique_operators) <= 1 + and all(s.strip() in params for s in variables) + and (len(unique_operators_left) == 0 or len(unique_operators_right) == 0) + ): # noqa: E501 variables_on_left = len(unique_operators_left) > 0 if len(variable_unique_operators) == 0 or variable_unique_operators[0] == "+": if comparator == "==": - return VariableExactSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactSumConstraint(variables[0], variables[1:]) # noqa: E501 + return ( + VariableExactSumConstraint(variables[-1], variables[:-1]) + if variables_on_left + else VariableExactSumConstraint(variables[0], variables[1:]) + ) # noqa: E501 elif comparator == "<=": # "B+C <= A" (maxsum) if variables_on_left else "A <= B+C" (minsum) - return VariableMaxSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinSumConstraint(variables[0], variables[1:]) # noqa: E501 + return ( + VariableMaxSumConstraint(variables[-1], variables[:-1]) + if variables_on_left + else VariableMinSumConstraint(variables[0], variables[1:]) + ) # noqa: E501 elif comparator == ">=": # "B+C >= A" (minsum) if variables_on_left else "A >= B+C" (maxsum) - return VariableMinSumConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxSumConstraint(variables[0], variables[1:]) # noqa: E501 + return ( + VariableMinSumConstraint(variables[-1], variables[:-1]) + if variables_on_left + else VariableMaxSumConstraint(variables[0], variables[1:]) + ) # noqa: E501 elif variable_unique_operators[0] == "*": if comparator == "==": - return VariableExactProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableExactProdConstraint(variables[0], variables[1:]) # noqa: E501 + return ( + VariableExactProdConstraint(variables[-1], variables[:-1]) + if variables_on_left + else VariableExactProdConstraint(variables[0], variables[1:]) + ) # noqa: E501 elif comparator == "<=": # "B*C <= A" (maxprod) if variables_on_left else "A <= B*C" (minprod) - return VariableMaxProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMinProdConstraint(variables[0], variables[1:]) # noqa: E501 + return ( + VariableMaxProdConstraint(variables[-1], variables[:-1]) + if variables_on_left + else VariableMinProdConstraint(variables[0], variables[1:]) + ) # noqa: E501 elif comparator == ">=": # "B*C >= A" (minprod) if variables_on_left else "A >= B*C" (maxprod) - return VariableMinProdConstraint(variables[-1], variables[:-1]) if variables_on_left else VariableMaxProdConstraint(variables[0], variables[1:]) # noqa: E501 + return ( + VariableMinProdConstraint(variables[-1], variables[:-1]) + if variables_on_left + else VariableMaxProdConstraint(variables[0], variables[1:]) + ) # noqa: E501 # left_num and right_num can't both be constants, or for other reasons we can't use a VariableConstraint return None @@ -268,7 +297,7 @@ def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: def to_equality_constraint( restriction: str, params: list[str] - ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: + ) -> AllEqualConstraint | AllDifferentConstraint | None: """Converts a restriction to either an equality or inequality constraint on all the parameters if possible.""" # check if all parameters are involved if len(params) != len(tune_params): @@ -293,12 +322,12 @@ def to_equality_constraint( return AllDifferentConstraint() return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") return None - + # remove functionally duplicate restrictions (preserves order and whitespace) if all(isinstance(r, str) for r in restrictions): # clean the restriction strings to functional equivalence - restrictions_cleaned = [r.replace(' ', '') for r in restrictions] - restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order + restrictions_cleaned = [r.replace(" ", "") for r in restrictions] + restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order # get the indices of the unique restrictions, use these to build a new list of restrictions restrictions_unique_indices = [restrictions_cleaned.index(r) for r in restrictions_cleaned_unique] restrictions = [restrictions[i] for i in restrictions_unique_indices] @@ -333,7 +362,10 @@ def to_equality_constraint( return parsed_restrictions -def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 + +def compile_to_constraints( + constraints: list[str], domains: dict, picklable=False +) -> list[tuple[Constraint, list[str], str | None]]: # noqa: E501 """Parses constraints in string format (referred to as restrictions) from a list of strings into a list of Constraints, parameters used, and source if applicable. Args: @@ -343,9 +375,9 @@ def compile_to_constraints(constraints: list[str], domains: dict, picklable=Fals Returns: list of tuples with restrictions, parameters used (list[str]), and source (str) if applicable. Returned restrictions are strings, functions, or Constraints depending on the options provided. - """ # noqa: E501 + """ # noqa: E501 parsed_restrictions = parse_restrictions(constraints, domains) - compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() + compiled_constraints: list[tuple[Constraint, list[str], str | None]] = list() for restriction, params_used in parsed_restrictions: if isinstance(restriction, str): # if it's a string, wrap it in a (compilable or compiled) function constraint @@ -364,3 +396,36 @@ def compile_to_constraints(constraints: list[str], domains: dict, picklable=Fals # return the restrictions and used parameters return compiled_constraints + + +# Utility functions + + +def is_or_evals_to_number(s: str) -> int | float | None: + """Check if the string is a number or can be evaluated to a number.""" + try: + # check if it's a number or solvable to a number (e.g. '32*2') + number = eval(s) + assert isinstance(number, (int, float)) + return number + except Exception: + # it's not a solvable subexpression, return None + return None + + +def extract_operators(expr: str) -> list[str]: + """Extracts all operators from an expression string.""" + # Regex for all supported binary operators: + # supported_operators = ["**", "*", "+", "-", "/"] + + # remove any whitespace from the expression + expr = expr.strip().replace(" ", "") + + # Match ** first to avoid matching * twice + pattern = r""" + (? @@ -55,9 +63,6 @@ END: Cython Metadata */ #define DL_EXPORT(t) t #endif #define __PYX_COMMA , -#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -#endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif @@ -90,7 +95,7 @@ END: Cython Metadata */ #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_ASSUME_SAFE_SIZE @@ -127,6 +132,8 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 @@ -194,6 +201,8 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX @@ -204,8 +213,6 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 - #undef CYTHON_CLINE_IN_TRACEBACK - #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS @@ -265,8 +272,11 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #ifndef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 1 + #endif + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 @@ -373,6 +383,15 @@ END: Cython Metadata */ #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif + #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work + #elif !defined(CYTHON_IMMORTAL_CONSTANTS) + #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) + #endif +#endif +#ifndef CYTHON_COMPRESS_STRINGS + #define CYTHON_COMPRESS_STRINGS 1 #endif #ifndef CYTHON_FAST_PYCCALL #define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL @@ -381,10 +400,9 @@ END: Cython Metadata */ #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #else -#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL) #endif #endif -#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #undef SHIFT #undef BASE @@ -460,35 +478,8 @@ END: Cython Metadata */ #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; - #endif - #endif - #if _MSC_VER < 1300 - #ifdef _WIN64 - typedef unsigned long long __pyx_uintptr_t; - #else - typedef unsigned int __pyx_uintptr_t; - #endif - #else - #ifdef _WIN64 - typedef unsigned __int64 __pyx_uintptr_t; - #else - typedef unsigned __int32 __pyx_uintptr_t; - #endif - #endif -#else - #include - typedef uintptr_t __pyx_uintptr_t; -#endif +#include +typedef uintptr_t __pyx_uintptr_t; #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 @@ -531,9 +522,9 @@ END: Cython Metadata */ #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000) #else - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) @@ -637,6 +628,12 @@ static int __Pyx_init_co_variables(void); #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif +#ifndef Py_TPFLAGS_IMMUTABLETYPE + #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8) +#endif +#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION + #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7) +#endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif @@ -669,11 +666,6 @@ static int __Pyx_init_co_variables(void); #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) -#elif CYTHON_BACKPORT_VECTORCALL - typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) @@ -703,7 +695,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(vo #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x03090000 +#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000) #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else @@ -720,6 +712,9 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(vo #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno)) #elif CYTHON_COMPILING_IN_GRAAL #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) @@ -810,7 +805,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #endif #define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) -#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#if CYTHON_USE_TYPE_SPECS #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ @@ -874,7 +869,10 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #endif #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else @@ -890,22 +888,55 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif -#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) - #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS +enum __Pyx_ReferenceSharing { + __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check + __Pyx_ReferenceSharing_OwnStrongReference, + __Pyx_ReferenceSharing_FunctionArgument, + __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar +}; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000 +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\ + (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\ + (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\ + (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0))) +#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1) +#else +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) #else #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i) #endif -#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS - #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE) + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) +#else + #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\ + __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +#endif +#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_PyList_GetItemRef(o, i)) +#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\ + __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ + __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i)) #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\ + __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ + __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i)) #endif +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_NewRef(PyList_GET_ITEM(o, i))) #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_XNewRef(PyList_GetItem(o, i))) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) @@ -966,15 +997,6 @@ static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) -#else - static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { - PyObject *module = PyImport_AddModule(name); - Py_XINCREF(module); - return module; - } -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif @@ -1081,15 +1103,6 @@ static int __Pyx_init_co_variables(void) { #endif #endif #include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else @@ -1138,6 +1151,15 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif +#ifdef CYTHON_FREETHREADING_COMPATIBLE +#if CYTHON_FREETHREADING_COMPATIBLE +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED +#else +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED +#endif +#else +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED +#endif #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING "" @@ -1340,7 +1362,7 @@ static const char* const __pyx_f[] = { "constraint/problem.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* Atomics.proto */ +/* Atomics.proto (used by UnpackUnboundCMethod) */ #include #ifndef CYTHON_ATOMICS #define CYTHON_ATOMICS 1 @@ -1376,6 +1398,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C atomics") #elif defined(__PYX_DEBUG_ATOMICS) @@ -1400,6 +1423,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C++ atomics") #elif defined(__PYX_DEBUG_ATOMICS) @@ -1409,6 +1433,7 @@ static const char* const __pyx_f[] = { (__GNUC_MINOR__ > 1 ||\ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) #define __pyx_atomic_ptr_type void* + #define __pyx_nonatomic_ptr_type void* #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1) @@ -1424,6 +1449,12 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value) + static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { + __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } #ifdef __PYX_DEBUG_ATOMICS #warning "Using GNU atomics" #endif @@ -1434,6 +1465,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_ptr_type void* #undef __pyx_nonatomic_int_type #define __pyx_nonatomic_int_type long + #define __pyx_nonatomic_ptr_type void* #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer) #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1) #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1) @@ -1450,6 +1482,12 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0) #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value) + static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { + __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } #ifdef __PYX_DEBUG_ATOMICS #pragma message ("Using MSVC atomics") #endif @@ -1460,33 +1498,27 @@ static const char* const __pyx_f[] = { #warning "Not using atomics" #endif #endif -#if CYTHON_ATOMICS - #define __pyx_add_acquisition_count(memview)\ - __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview)) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview)) -#else - #define __pyx_add_acquisition_count(memview)\ - __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) -#endif -/* CriticalSections.proto */ +/* CriticalSectionsDefinition.proto (used by CriticalSections) */ #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __Pyx_PyCriticalSection void* #define __Pyx_PyCriticalSection2 void* -#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs -#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs -#define __Pyx_PyCriticalSection_End1(cs) -#define __Pyx_PyCriticalSection_End2(cs) +#define __Pyx_PyCriticalSection_End(cs) +#define __Pyx_PyCriticalSection2_End(cs) #else #define __Pyx_PyCriticalSection PyCriticalSection #define __Pyx_PyCriticalSection2 PyCriticalSection2 -#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin -#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin -#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End -#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End +#define __Pyx_PyCriticalSection_End PyCriticalSection_End +#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End +#endif + +/* CriticalSections.proto (used by ParseKeywordsImpl) */ +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs) +#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs) +#else +#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin +#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin #endif #if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_BEGIN_CRITICAL_SECTION(o) { @@ -1496,7 +1528,7 @@ static const char* const __pyx_f[] = { #define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif -/* IncludeStructmemberH.proto */ +/* IncludeStructmemberH.proto (used by FixUpExtensionType) */ #include /* #### Code section: numeric_typedefs ### */ @@ -1510,7 +1542,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr; struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr; struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr; -/* "constraint/problem.py":162 +/* "constraint/problem.py":163 * return * elif isinstance(constraint, list): * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" # <<<<<<<<<<<<<< @@ -1524,7 +1556,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr { }; -/* "constraint/problem.py":237 +/* "constraint/problem.py":238 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< @@ -1537,7 +1569,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedL }; -/* "constraint/problem.py":241 +/* "constraint/problem.py":242 * solutions: list[dict] = self.getSolutions() * if order is None or len(order) == 1: * return list(tuple(solution.values()) for solution in solutions) # <<<<<<<<<<<<<< @@ -1551,7 +1583,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr { }; -/* "constraint/problem.py":243 +/* "constraint/problem.py":244 * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) * return list(get_in_order(params) for params in solutions) # <<<<<<<<<<<<<< @@ -1566,7 +1598,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr { }; -/* "constraint/problem.py":286 +/* "constraint/problem.py":289 * # check if there are any precompiled FunctionConstraints when there shouldn't be * if picklable: * assert not any(isinstance(c, FunctionConstraint) for c, _ in constraints), f"You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why)" # noqa E501 # <<<<<<<<<<<<<< @@ -1656,7 +1688,7 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr { #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) -/* PyErrExceptionMatches.proto */ +/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); @@ -1664,7 +1696,7 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif -/* PyThreadStateGet.proto */ +/* PyThreadStateGet.proto (used by PyErrFetchRestore) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; @@ -1682,7 +1714,7 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif -/* PyErrFetchRestore.proto */ +/* PyErrFetchRestore.proto (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) @@ -1707,20 +1739,20 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif -/* PyObjectGetAttrStr.proto */ +/* PyObjectGetAttrStr.proto (used by PyObjectGetAttrStrNoError) */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif -/* PyObjectGetAttrStrNoError.proto */ +/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); -/* TupleAndListFromArray.proto */ +/* TupleAndListFromArray.proto (used by fastcall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1728,13 +1760,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_s static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif -/* IncludeStringH.proto */ +/* IncludeStringH.proto (used by BytesEquals) */ #include -/* BytesEquals.proto */ +/* BytesEquals.proto (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); -/* UnicodeEquals.proto */ +/* UnicodeEquals.proto (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ @@ -1767,25 +1799,16 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #endif #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) -#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#if CYTHON_METH_FASTCALL #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start) #else -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS #endif -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static CYTHON_INLINE int __Pyx_ParseKeywords( - PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], - PyObject *kwds2, PyObject *values[], - Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, - const char* function_name, - int ignore_unknown_kwargs -); +/* py_dict_items.proto (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); -/* CallCFunction.proto */ +/* CallCFunction.proto (used by CallUnboundCMethod0) */ #define __Pyx_CallCFunction(cfunc, self, args)\ ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) #define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ @@ -1795,52 +1818,26 @@ static CYTHON_INLINE int __Pyx_ParseKeywords( #define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\ ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames) -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#if !CYTHON_VECTORCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs); -#endif -#define __Pyx_BUILD_ASSERT_EXPR(cond)\ - (sizeof(char [1 - 2*!(cond)]) - 1) -#ifndef Py_MEMBER_SIZE -#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) -#endif -#if !CYTHON_VECTORCALL -#if PY_VERSION_HEX >= 0x03080000 - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets() - #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) -#else - static size_t __pyx_pyframe_localsplus_offset = 0; - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets()\ - ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ - (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) - #define __Pyx_PyFrame_GetLocalsplus(frame)\ - (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) -#endif -#endif -#endif - -/* PyObjectCall.proto */ +/* PyObjectCall.proto (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif -/* PyObjectCallMethO.proto */ +/* PyObjectCallMethO.proto (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif -/* PyObjectFastCall.proto */ +/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); -/* UnpackUnboundCMethod.proto */ +/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */ typedef struct { PyObject *type; PyObject **method_name; @@ -1873,6 +1870,59 @@ static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_Ca #define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) #endif +/* CallUnboundCMethod0.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + +/* py_dict_values.proto (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); + +/* OwnedDictNext.proto (used by ParseKeywordsImpl) */ +#if CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue); +#else +CYTHON_INLINE +static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue); +#endif + +/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywordsImpl.export */ +static int __Pyx_ParseKeywordsTuple( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name +); +static int __Pyx_ParseKeywordDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + /* CallUnboundCMethod2.proto */ CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); @@ -1882,11 +1932,20 @@ static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction * #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif +/* ParseKeywords.proto */ +static CYTHON_INLINE int __Pyx_ParseKeywords( + PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], + PyObject *kwds2, PyObject *values[], + Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); -/* PyDictVersioning.proto */ +/* PyDictVersioning.proto (used by GetModuleGlobalName) */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) @@ -1897,7 +1956,7 @@ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ + (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ @@ -1933,7 +1992,7 @@ static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_ve static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif -/* PyObjectDelAttr.proto */ +/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 #define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL) #else @@ -1950,9 +2009,12 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr #endif /* AssertionsEnabled.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000 static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) + #if __clang__ || __GNUC__ + __attribute__((no_sanitize("thread"))) + #endif static int __Pyx_init_assertions_enabled(void) { PyObject *builtins, *debug, *debug_str; int flag; @@ -1977,6 +2039,9 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr #define __pyx_assertions_enabled() (!Py_OptimizeFlag) #endif +/* PyAssertionError_Check.proto */ +#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError) + /* PyObjectFormatSimple.proto */ #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_FormatSimple(s, f) (\ @@ -1994,11 +2059,11 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr PyObject_Format(s, f)) #endif -/* JoinPyUnicode.proto */ +/* JoinPyUnicode.export */ static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); -/* RaiseException.proto */ +/* RaiseException.export */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* SliceObject.proto */ @@ -2025,6 +2090,9 @@ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* s /* PyUnicode_Unicode.proto */ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj); +/* PyValueError_Check.proto */ +#define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError) + /* HasAttr.proto */ #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) @@ -2032,10 +2100,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj); static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); #endif +/* PyTypeError_Check.proto */ +#define __Pyx_PyExc_TypeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TypeError) + /* RaiseUnboundLocalError.proto */ static void __Pyx_RaiseUnboundLocalError(const char *varname); -/* GetException.proto */ +/* GetException.proto (used by pep479) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); @@ -2046,7 +2117,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /* pep479.proto */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); -/* ListAppend.proto */ +/* ListAppend.proto (used by append) */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; @@ -2067,16 +2138,15 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif -/* PyObjectCall2Args.proto */ +/* PyObjectCall2Args.proto (used by PyObjectCallMethod1) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* PyObjectGetMethod.proto */ +/* PyObjectGetMethod.proto (used by PyObjectCallMethod1) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); +#endif -/* PyObjectCallMethod1.proto */ +/* PyObjectCallMethod1.proto (used by append) */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* append.proto */ @@ -2089,7 +2159,7 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); #define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) #endif -/* PyObjectVectorCallKwBuilder.proto */ +/* PyObjectVectorCallKwBuilder.proto (used by PyObjectVectorCallMethodKwBuilder) */ CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); #if CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03090000 @@ -2126,11 +2196,13 @@ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); +/* ArgTypeTestFunc.export */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS @@ -2159,23 +2231,10 @@ static void __Pyx_RaiseClosureNameError(const char *varname); /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); -/* UnicodeConcatInPlace.proto */ -# if CYTHON_COMPILING_IN_CPYTHON - #if CYTHON_REFNANNY - #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) - #else - #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right) - #endif - static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right - #if CYTHON_REFNANNY - , void* __pyx_refnanny - #endif - ); -#else -#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat +/* PyRange_Check.proto */ +#if CYTHON_COMPILING_IN_PYPY && !defined(PyRange_Check) + #define PyRange_Check(obj) __Pyx_TypeCheck((obj), &PyRange_Type) #endif -#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ - PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) /* DictGetItem.proto */ #if !CYTHON_COMPILING_IN_PYPY @@ -2197,19 +2256,19 @@ static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t #define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) #endif -/* PyObjectCallNoArg.proto */ +/* PyObjectCallNoArg.proto (used by PyObjectCallMethod0) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); -/* PyObjectCallMethod0.proto */ +/* PyObjectCallMethod0.proto (used by dict_iter) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); -/* RaiseNoneIterError.proto */ +/* RaiseNoneIterError.proto (used by UnpackTupleError) */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); -/* UnpackTupleError.proto */ +/* UnpackTupleError.proto (used by UnpackTuple2) */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); -/* UnpackTuple2.proto */ +/* UnpackTuple2.proto (used by dict_iter) */ static CYTHON_INLINE int __Pyx_unpack_tuple2( PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( @@ -2223,6 +2282,23 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); +/* CheckTypeForFreelists.proto */ +#if CYTHON_USE_FREELISTS +#if CYTHON_USE_TYPE_SPECS +#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp))) +#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS Py_TPFLAGS_IS_ABSTRACT +#else +#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size))) +#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE) +#endif +#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\ + (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\ + (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS))) +#endif + +/* AllocateExtensionType.proto */ +static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final); + /* CallTypeTraverse.proto */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 @@ -2230,19 +2306,19 @@ static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif -/* LimitedApiGetTypeDict.proto */ +/* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); #endif -/* SetItemOnTypeDict.proto */ +/* SetItemOnTypeDict.proto (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v); #define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v) /* FixUpExtensionType.proto */ static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -/* ValidateBasesTuple.proto */ +/* ValidateBasesTuple.proto (used by PyType_Ready) */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif @@ -2250,20 +2326,16 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportDottedModule.proto */ -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); +/* ImportImpl.export */ +static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level); -/* ListPack.proto */ -static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); +/* Import.proto */ +static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); -/* GetTopmostException.proto */ +/* GetTopmostException.proto (used by SaveResetException) */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif @@ -2279,28 +2351,39 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif -/* FetchSharedCythonModule.proto */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void); +/* PyImportError_Check.proto */ +#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError) + +/* dict_setdefault.proto (used by FetchCommonType) */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value); + +/* AddModuleRef.proto (used by FetchSharedCythonModule) */ +#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\ + __PYX_LIMITED_VERSION_HEX < 0x030d0000) + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name); +#else + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#endif -/* dict_setdefault.proto */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); +/* FetchSharedCythonModule.proto (used by FetchCommonType) */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); -/* FetchCommonType.proto */ +/* FetchCommonType.proto (used by CommonTypesMetaclass) */ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); -/* CommonTypesMetaclass.proto */ +/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */ static int __pyx_CommonTypesMetaclass_init(PyObject *module); #define __Pyx_CommonTypesMetaclass_USED -/* PyMethodNew.proto */ +/* PyMethodNew.proto (used by CythonFunctionShared) */ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); -/* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */ +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif -/* CythonFunctionShared.proto */ +/* CythonFunctionShared.proto (used by CythonFunction) */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 @@ -2330,14 +2413,15 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL ||\ - (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) +#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL __pyx_vectorcallfunc func_vectorcall; #endif #if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_dict; +#endif PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; @@ -2382,7 +2466,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) @@ -2407,10 +2491,10 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif -/* CalculateMetaclass.proto */ +/* CalculateMetaclass.proto (used by Py3ClassCreate) */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); -/* PyObjectLookupSpecial.proto */ +/* PyObjectLookupSpecial.proto (used by Py3ClassCreate) */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) @@ -2426,14 +2510,14 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); -/* CLineInTraceback.proto */ +/* CLineInTraceback.proto (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #else #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif -/* CodeObjectCache.proto */ +/* CodeObjectCache.proto (used by AddTraceback) */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject __Pyx_CachedCodeObjectType; #else @@ -2476,7 +2560,7 @@ typedef const char *__Pyx_TypeName; #define __Pyx_DECREF_TypeName(obj) #endif -/* GCCDiagnostics.proto */ +/* GCCDiagnostics.proto (used by CIntToPy) */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif @@ -2514,7 +2598,16 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) #endif -/* SwapException.proto */ +/* GetRuntimeVersion.proto */ +#if __PYX_LIMITED_VERSION_HEX < 0x030b0000 +static unsigned long __Pyx_cached_runtime_version = 0; +static void __Pyx_init_runtime_version(void); +#else +#define __Pyx_init_runtime_version() +#endif +static unsigned long __Pyx_get_runtime_version(void); + +/* SwapException.proto (used by CoroutineBase) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); @@ -2522,16 +2615,16 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif -/* IterNextPlain.proto */ +/* IterNextPlain.proto (used by CoroutineBase) */ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator); #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void); #endif -/* ReturnWithStopIteration.proto */ +/* ReturnWithStopIteration.proto (used by CoroutineBase) */ static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext); -/* CoroutineBase.proto */ +/* CoroutineBase.proto (used by Generator) */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); #if CYTHON_USE_EXC_INFO_STACK @@ -2548,7 +2641,9 @@ typedef struct __pyx_CoroutineObject { __pyx_coroutine_body_t body; PyObject *closure; __Pyx_ExcInfoStruct gi_exc_state; +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *gi_weakreflist; +#endif PyObject *classobj; PyObject *yieldfrom; __Pyx_pyiter_sendfunc yieldfrom_am_send; @@ -2616,12 +2711,12 @@ static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); -/* GetRuntimeVersion.proto */ -static unsigned long __Pyx_get_runtime_version(void); - /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); +/* DecompressString.proto */ +static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo); + /* MultiPhaseInitModuleState.proto */ #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE static PyObject *__Pyx_State_FindModule(void*); @@ -2679,205 +2774,9 @@ int __pyx_module_is_main_constraint__problem = 0; /* Implementation of "constraint.problem" */ /* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_ImportError; -static PyObject *__pyx_builtin_AssertionError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_zip; -static PyObject *__pyx_builtin_range; /* #### Code section: string_decls ### */ -static const char __pyx_k_[] = ")."; -static const char __pyx_k_Q[] = "\230Q"; -static const char __pyx_k_c[] = "c"; -static const char __pyx_k_v[] = "v"; -static const char __pyx_k__2[] = "."; -static const char __pyx_k__3[] = "?"; -static const char __pyx_k__4[] = "\240\021"; -static const char __pyx_k__5[] = "\240\001"; -static const char __pyx_k__6[] = "_"; -static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k_Q_2[] = "\240Q"; -static const char __pyx_k_doc[] = "__doc__"; -static const char __pyx_k_msg[] = "msg"; -static const char __pyx_k_pop[] = "pop"; -static const char __pyx_k_sys[] = "sys"; -static const char __pyx_k_zip[] = "zip"; -static const char __pyx_k_A_Kq[] = "\200A\360\032\000\t\r\210K\220q"; -static const char __pyx_k_A_t1[] = "\200A\360\030\000\t\020\210t\2201"; -static const char __pyx_k_None[] = "None"; -static const char __pyx_k_bool[] = "bool"; -static const char __pyx_k_copy[] = "copy"; -static const char __pyx_k_func[] = "__func__"; -static const char __pyx_k_init[] = "__init__"; -static const char __pyx_k_keys[] = "keys"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_next[] = "next"; -static const char __pyx_k_self[] = "self"; -static const char __pyx_k_send[] = "send"; -static const char __pyx_k_spec[] = "__spec__"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_warn[] = "warn"; -static const char __pyx_k_Union[] = "Union"; -static const char __pyx_k_clear[] = "clear"; -static const char __pyx_k_close[] = "close"; -static const char __pyx_k_order[] = "order"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_reset[] = "reset"; -static const char __pyx_k_throw[] = "throw"; -static const char __pyx_k_value[] = "value"; -static const char __pyx_k_Domain[] = "Domain"; -static const char __pyx_k_Solver[] = "Solver"; -static const char __pyx_k_append[] = "append"; -static const char __pyx_k_domain[] = "domain"; -static const char __pyx_k_enable[] = "enable"; -static const char __pyx_k_extend[] = "extend"; -static const char __pyx_k_module[] = "__module__"; -static const char __pyx_k_params[] = "params"; -static const char __pyx_k_parsed[] = "parsed"; -static const char __pyx_k_return[] = "return"; -static const char __pyx_k_solver[] = "solver"; -static const char __pyx_k_typing[] = "typing"; -static const char __pyx_k_values[] = "values"; -static const char __pyx_k_Problem[] = "Problem"; -static const char __pyx_k_a_L_AZq[] = "\320\004&\240a\360(\000\t\r\210L\230\001\330\014\020\220\014\230A\230Z\240q"; -static const char __pyx_k_disable[] = "disable"; -static const char __pyx_k_domains[] = "domains"; -static const char __pyx_k_genexpr[] = "genexpr"; -static const char __pyx_k_getArgs[] = "_getArgs"; -static const char __pyx_k_getitem[] = "__getitem__"; -static const char __pyx_k_prepare[] = "__prepare__"; -static const char __pyx_k_Callable[] = "Callable"; -static const char __pyx_k_Hashable[] = "Hashable"; -static const char __pyx_k_Optional[] = "Optional"; -static const char __pyx_k_Sequence[] = "Sequence"; -static const char __pyx_k_add_note[] = "add_note"; -static const char __pyx_k_deepcopy[] = "deepcopy"; -static const char __pyx_k_list_str[] = "list[str]"; -static const char __pyx_k_operator[] = "operator"; -static const char __pyx_k_qualname[] = "__qualname__"; -static const char __pyx_k_set_name[] = "__set_name__"; -static const char __pyx_k_solution[] = "solution"; -static const char __pyx_k_solver_2[] = "_solver"; -static const char __pyx_k_validate[] = "validate"; -static const char __pyx_k_variable[] = "variable"; -static const char __pyx_k_warnings[] = "warnings"; -static const char __pyx_k_A_D_Q_KvQ[] = "\200A\360\024\000\t\r\210D\220\r\230Q\330\010\014\210K\220v\230Q"; -static const char __pyx_k_TypeError[] = "TypeError"; -static const char __pyx_k_getSolver[] = "getSolver"; -static const char __pyx_k_isenabled[] = "isenabled"; -static const char __pyx_k_metaclass[] = "__metaclass__"; -static const char __pyx_k_picklable[] = "picklable"; -static const char __pyx_k_setSolver[] = "setSolver"; -static const char __pyx_k_size_dict[] = "size_dict"; -static const char __pyx_k_size_list[] = "size_list"; -static const char __pyx_k_solutions[] = "solutions"; -static const char __pyx_k_variables[] = "_variables"; -static const char __pyx_k_Constraint[] = "Constraint"; -static const char __pyx_k_ValueError[] = "ValueError"; -static const char __pyx_k_constraint[] = "constraint"; -static const char __pyx_k_itemgetter[] = "itemgetter"; -static const char __pyx_k_list_tuple[] = "list[tuple]"; -static const char __pyx_k_preProcess[] = "preProcess"; -static const char __pyx_k_resetState[] = "resetState"; -static const char __pyx_k_ImportError[] = "ImportError"; -static const char __pyx_k_addVariable[] = "addVariable"; -static const char __pyx_k_constraints[] = "_constraints"; -static const char __pyx_k_getSolution[] = "getSolution"; -static const char __pyx_k_variables_2[] = "variables"; -static const char __pyx_k_addVariables[] = "addVariables"; -static const char __pyx_k_allvariables[] = "allvariables"; -static const char __pyx_k_getSolutions[] = "getSolutions"; -static const char __pyx_k_get_in_order[] = "get_in_order"; -static const char __pyx_k_initializing[] = "_initializing"; -static const char __pyx_k_is_coroutine[] = "_is_coroutine"; -static const char __pyx_k_process_mode[] = "_process_mode"; -static const char __pyx_k_vconstraints[] = "vconstraints"; -static const char __pyx_k_Problem_reset[] = "Problem.reset"; -static const char __pyx_k_addConstraint[] = "addConstraint"; -static const char __pyx_k_constraints_2[] = "constraints"; -static const char __pyx_k_freethreading[] = "freethreading"; -static const char __pyx_k_AssertionError[] = "AssertionError"; -static const char __pyx_k_ParallelSolver[] = "ParallelSolver"; -static const char __pyx_k_Problem___init[] = "Problem.__init__"; -static const char __pyx_k_is_gil_enabled[] = "_is_gil_enabled"; -static const char __pyx_k_solutions_dict[] = "solutions_dict"; -static const char __pyx_k_solutions_list[] = "solutions_list"; -static const char __pyx_k_Domain_is_empty[] = "Domain is empty"; -static const char __pyx_k_collections_abc[] = "collections.abc"; -static const char __pyx_k_getSolutionIter[] = "getSolutionIter"; -static const char __pyx_k_str_constraints[] = "_str_constraints"; -static const char __pyx_k_Problem__getArgs[] = "Problem._getArgs"; -static const char __pyx_k_Optional_Sequence[] = "Optional[Sequence]"; -static const char __pyx_k_Problem_getSolver[] = "Problem.getSolver"; -static const char __pyx_k_Problem_setSolver[] = "Problem.setSolver"; -static const char __pyx_k_constraint_domain[] = "constraint.domain"; -static const char __pyx_k_constraint_parser[] = "constraint.parser"; -static const char __pyx_k_requires_pickling[] = "requires_pickling"; -static const char __pyx_k_FunctionConstraint[] = "FunctionConstraint"; -static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; -static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_constraint_problem[] = "constraint.problem"; -static const char __pyx_k_constraint_solvers[] = "constraint.solvers"; -static const char __pyx_k_A_oT_T_QR_4q_1_t8_q[] = "\200A\360\034\000\t\022\220\035\230o\250T\260\031\270!\270:\300T\310\030\320QR\330\010\013\2104\210q\330\014\023\2201\330\010\017\210t\2208\230=\250\001\250\031\260-\270q"; -static const char __pyx_k_Problem_addVariable[] = "Problem.addVariable"; -static const char __pyx_k_Problem_getSolution[] = "Problem.getSolution"; -static const char __pyx_k_Problem_addVariables[] = "Problem.addVariables"; -static const char __pyx_k_Problem_getSolutions[] = "Problem.getSolutions"; -static const char __pyx_k_A_oT_T_QR_4q_1_t8_q_a[] = "\200A\360\034\000\t\022\220\035\230o\250T\260\031\270!\270:\300T\310\030\320QR\330\010\013\2104\210q\330\014\023\2201\330\010\017\210t\2208\230<\240q\250\t\260\035\270a"; -static const char __pyx_k_A_oT_T_QR_4q_4q_t8_1I[] = "\200A\360 \000\t\022\220\035\230o\250T\260\031\270!\270:\300T\310\030\320QR\330\010\013\2104\210q\330\014\023\2204\220q\230\001\330\010\017\210t\2208\320\033+\2501\250I\260]\300!"; -static const char __pyx_k_Problem_addConstraint[] = "Problem.addConstraint"; -static const char __pyx_k_Problem_reset_line_44[] = "Problem.reset (line 44)"; -static const char __pyx_k_constraint_problem_py[] = "constraint/problem.py"; -static const char __pyx_k_g_B_M_6_E_Cq_s_vQ_z_1[] = "\320\004&\240g\320-B\300!\340\010 \240\004\240M\260\021\330\010\013\2106\220\023\220E\230\023\230C\230q\240\007\240s\250!\330\014\027\220v\230Q\330\010\027\220z\240\022\2401\330\010\023\220=\240\001"; -static const char __pyx_k_compile_to_constraints[] = "compile_to_constraints"; -static const char __pyx_k_constraint_constraints[] = "constraint.constraints"; -static const char __pyx_k_getSolutionsAsListDict[] = "getSolutionsAsListDict"; -static const char __pyx_k_Problem_getSolutionIter[] = "Problem.getSolutionIter"; -static const char __pyx_k_getSolutionsOrderedList[] = "getSolutionsOrderedList"; -static const char __pyx_k_Problem_getSolver_line_72[] = "Problem.getSolver (line 72)"; -static const char __pyx_k_Problem_setSolver_line_57[] = "Problem.setSolver (line 57)"; -static const char __pyx_k_OptimizedBacktrackingSolver[] = "OptimizedBacktrackingSolver"; -static const char __pyx_k_Problem_addVariable_line_86[] = "Problem.addVariable (line 86)"; -static const char __pyx_k_CompilableFunctionConstraint[] = "CompilableFunctionConstraint"; -static const char __pyx_k_Problem_getSolution_line_178[] = "Problem.getSolution (line 178)"; -static const char __pyx_k_Problem_addVariables_line_116[] = "Problem.addVariables (line 116)"; -static const char __pyx_k_Problem_getSolutions_line_197[] = "Problem.getSolutions (line 197)"; -static const char __pyx_k_Union_Constraint_Callable_str[] = "Union[Constraint, Callable, str]"; -static const char __pyx_k_A_9Ct1_D_AQ_Qha_T_1_AXQ_V1A_1A[] = "\320\004$\240A\360 \000\t\014\2109\220C\220t\2301\330\014\022\220\"\320\024<\270D\300\001\300\021\330\014\022\220*\230A\230Q\330\010\013\210:\220Q\220h\230a\330\014\025\220T\230\031\240!\2401\330\r\024\220A\220X\230Q\330\014\025\220V\2301\230A\340\014\022\220!\330\014\022\220)\2301\230A\330\010\013\2104\210q\330\014\022\220*\230A\230Q\330\010\014\210K\220q\230\014\240A"; -static const char __pyx_k_Problem_addConstraint_line_139[] = "Problem.addConstraint (line 139)"; -static const char __pyx_k_Problem_getSolutionsAsListDict[] = "Problem.getSolutionsAsListDict"; -static const char __pyx_k_q_k_a_we1_5Q_3at_b_d_q_izQR_Cs[] = "\320\004\027\220q\330\010\022\220$\220k\240\025\240a\330\010\027\220w\230e\2401\330\0105\260Q\360\006\000\t\014\2103\210a\210t\320\023&\240b\250\001\340\014\020\220\016\230d\240!\330\020\031\320\031/\250q\260\001\260\035\270i\300z\320QR\330\020\024\220C\220s\230%\230q\330\024\030\230\016\240a\240s\250!\360\006\000\t\r\210L\230\r\240T\250\021\330\014\017\210t\2201\330\020\034\230D\240\001\240\021\330\014\027\220w\230b\240\014\250A\360\006\000\t\014\2101\330\014\023\320\023%\320%Y\320YZ\340\010\027\220q\330\010\014\210L\230\001\330\014\030\230\001\230\034\240Q\330\010\014\210L\230\r\240Q\330\014\020\220\014\230A\330\020\034\230A\230Y\240g\250R\250|\2701\330\010\014\210L\230\r\240[\260\001\330\014\026\220k\240\021\240+\250Y\260m\3001\330\010\014\210J\220g\230W\240A\330\014\022\220+\230Q\330\014\017\210t\2201\330\020\027\220v\230V\2401\340\010\017\210y\230\r\240Q"; -static const char __pyx_k_xq_Kwc_A_1_2_z_j_3ddhhiimmn_Qd[] = "\320\004\027\220x\230q\360\014\000\t\r\210K\220w\230c\320!<\270A\330\010\014\320\014:\270!\330\010\014\320\014+\2501\330\010\014\320\0142\260!\360\006\000\t\020\210z\230\021\230$\230j\250\t\260\022\3203d\320dh\320hi\320im\320mn\360\006\000\t\014\210:\220Q\220d\230*\240A\330\014\020\220\001\220\021\330\014\017\210t\2204\220x\230\250d\260$\260a\330\020\024\220A\220Q"; -static const char __pyx_k_A_z_5Qa_Cq_t1Cq_8_Qa_1_1A_z_A_j[] = "\200A\330\016\025\320\025'\240z\260\021\330\t\n\340\010\031\230\024\320\0355\260Q\260a\330\010\024\220C\220q\230\001\330\010\037\230t\2401\240C\240q\320(8\270\005\270Q\270a\330\010\013\2101\340\014\030\230\003\2301\230A\330\014\017\210z\230\023\230A\330\020\026\220j\240\001\330\024\026\220d\230*\240B\240a\340\010\t\330\014\r\330\014\r\330\014\r"; -static const char __pyx_k_Add_a_constraint_to_the_problem[] = "Add a constraint to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(lambda a, b: b == a+1, [\"a\", \"b\"])\n >>> problem.addConstraint(\"b == a+1 and a+b >= 2\") # experimental string format, automatically parsed, preferable over callables\n >>> solutions = problem.getSolutions()\n >>>\n\n Args:\n constraint (instance of :py:class:`Constraint`, function to be wrapped by :py:class:`FunctionConstraint`, or string expression):\n Constraint to be included in the problem. Can be either a Constraint, a callable (function or lambda), or Python-evaluable string expression that will be parsed automatically.\n variables (set or sequence of variables): :py:class:`Variables` affected\n by the constraint (default to all variables). Depending\n on the constraint type the order may be important.\n "; -static const char __pyx_k_J_UV_Ql_q_A_Bnno_4z_a_xq_q_1L_9[] = "\320\004(\320(J\310+\320UV\360&\000\t\014\210:\220Q\220l\240!\330\014\020\320\020!\240\027\250\001\250\021\330\014\r\330\r\027\220q\230\014\240A\330\014!\320!@\300\002\320Bn\320no\330\014\020\320\020!\240\027\250\001\250\021\330\014\r\360\006\000\t\014\2104\210z\230\021\230,\240a\330\014\017\210x\220q\230\001\340\020\035\320\035/\250q\260\001\330\021\033\2301\230L\250\001\330\020\035\320\0359\270\021\270!\340\020\026\220a\330\020\026\220j\240\001\240\021\330\010\014\210M\230\027\240\002\240,\250a"; -static const char __pyx_k_Problem__getArgs_locals_genexpr[] = "Problem._getArgs..genexpr"; -static const char __pyx_k_Problem_getSolutionsOrderedList[] = "Problem.getSolutionsOrderedList..genexpr"; -static const char __pyx_k_duplicate_parameter_configurati[] = " duplicate parameter configurations in searchspace, should not happen."; -static const char __pyx_k_solver_is_not_instance_of_Solve[] = "`solver` is not instance of Solver class (is "; -static const char __pyx_k_tuple_list_tuple_dict_tuple_int[] = "tuple[list[tuple], dict[tuple, int], int]"; -static const char __pyx_k_Add_a_variable_to_the_problem_Ex[] = "Add a variable to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariable(\"a\", [1, 2])\n >>> problem.getSolution() in ({'a': 1}, {'a': 2})\n True\n\n Args:\n variable (hashable object): Object representing a problem\n variable\n domain (list, tuple, or instance of :py:class:`Domain`): Set of items\n defining the possible values that the given variable may\n assume\n "; -static const char __pyx_k_Add_one_or_more_variables_to_the[] = "Add one or more variables to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> solutions = problem.getSolutions()\n >>> len(solutions)\n 9\n >>> {'a': 3, 'b': 1} in solutions\n True\n\n Args:\n variables (sequence of hashable objects): Any object\n containing a sequence of objects represeting problem\n variables\n domain (list, tuple, or instance of :py:class:`Domain`): Set of items\n defining the possible values that the given variables\n may assume\n "; -static const char __pyx_k_Change_the_problem_solver_curren[] = "Change the problem solver currently in use.\n\n Example:\n >>> solver = OptimizedBacktrackingSolver()\n >>> problem = Problem(solver)\n >>> problem.getSolver() is solver\n True\n\n Args:\n solver (instance of a :py:class:`Solver`): New problem\n solver\n "; -static const char __pyx_k_Class_used_to_define_a_problem_a[] = "Class used to define a problem and retrieve solutions."; -static const char __pyx_k_Constraints_must_be_instances_of[] = "Constraints must be instances of subclasses of the Constraint class"; -static const char __pyx_k_Domains_must_be_instances_of_sub[] = "Domains must be instances of subclasses of the Domain class"; -static const char __pyx_k_Expected_constraints_to_be_strin[] = "Expected constraints to be strings, got "; -static const char __pyx_k_Find_and_return_a_solution_to_th[] = "Find and return a solution to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.getSolution() is None\n True\n >>> problem.addVariables([\"a\"], [42])\n >>> problem.getSolution()\n {'a': 42}\n\n Returns:\n dictionary mapping variables to values: Solution for the problem\n "; -static const char __pyx_k_Find_and_return_all_solutions_to[] = "Find and return all solutions to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.getSolutions() == []\n True\n >>> problem.addVariables([\"a\"], [42])\n >>> problem.getSolutions()\n [{'a': 42}]\n\n Returns:\n list of dictionaries mapping variables to values: All solutions for the problem\n "; static const char __pyx_k_Module_containing_the_code_for_p[] = "Module containing the code for problem definitions."; -static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; -static const char __pyx_k_Obtain_the_problem_solver_curren[] = "Obtain the problem solver currently in use.\n\n Example:\n >>> solver = OptimizedBacktrackingSolver()\n >>> problem = Problem(solver)\n >>> problem.getSolver() is solver\n True\n\n Returns:\n instance of a :py:class:`Solver` subclass: Solver currently in use\n "; -static const char __pyx_k_ParallelSolver_is_currently_expe[] = "ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues."; -static const char __pyx_k_Problem_addConstraint_locals_gen[] = "Problem.addConstraint..genexpr"; -static const char __pyx_k_Problem_getSolutionIter_line_216[] = "Problem.getSolutionIter (line 216)"; -static const char __pyx_k_Reset_the_current_problem_defini[] = "Reset the current problem definition.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariable(\"a\", [1, 2])\n >>> problem.reset()\n >>> problem.getSolution()\n >>>\n "; -static const char __pyx_k_Return_an_iterator_to_the_soluti[] = "Return an iterator to the solutions of the problem.\n\n Example:\n >>> problem = Problem()\n >>> list(problem.getSolutionIter()) == []\n True\n >>> problem.addVariables([\"a\"], [42])\n >>> iter = problem.getSolutionIter()\n >>> next(iter)\n {'a': 42}\n >>> next(iter)\n Traceback (most recent call last):\n ...\n StopIteration\n "; -static const char __pyx_k_Tried_to_insert_duplicated_varia[] = "Tried to insert duplicated variable "; -static const char __pyx_k_Using_the_ParallelSolver_in_Thre[] = "Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance."; -static const char __pyx_k_You_have_used_FunctionConstraint[] = "You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why)"; -static const char __pyx_k_Problem_getSolutionsOrderedList_2[] = "Problem.getSolutionsOrderedList"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_solver); /* proto */ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ @@ -2893,7 +2792,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_order); /* proto */ -static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_order, PyObject *__pyx_v_validate); /* proto */ +static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_order, int __pyx_v_validate); /* proto */ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8_getArgs_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_picklable); /* proto */ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -2921,24 +2820,6 @@ typedef struct { PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED - PyTypeObject *__pyx_CyFunctionType; - #endif - #ifdef __Pyx_FusedFunction_USED - PyTypeObject *__pyx_FusedFunctionType; - #endif - #ifdef __Pyx_Generator_USED - PyTypeObject *__pyx_GeneratorType; - #endif - #ifdef __Pyx_IterableCoroutine_USED - PyTypeObject *__pyx_IterableCoroutineType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineAwaitType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineType; - #endif PyObject *__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr; PyObject *__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList; PyObject *__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr; @@ -2949,11 +2830,14 @@ typedef struct { PyTypeObject *__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr; PyTypeObject *__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr; PyTypeObject *__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values; PyObject *__pyx_slice[1]; - PyObject *__pyx_tuple[4]; + PyObject *__pyx_tuple[3]; PyObject *__pyx_codeobj_tab[17]; - PyObject *__pyx_string_tab[174]; + PyObject *__pyx_string_tab[190]; + PyObject *__pyx_number_tab[1]; /* #### Code section: module_state_contents ### */ #if CYTHON_USE_FREELISTS @@ -2988,6 +2872,9 @@ PyTypeObject *__pyx_CommonTypesMetaclassType; PyObject *__Pyx_CachedMethodType; #endif +/* CythonFunctionShared.module_state_decls */ +PyTypeObject *__pyx_CyFunctionType; + /* CodeObjectCache.module_state_decls */ struct __Pyx_CodeObjectCache __pyx_code_cache; @@ -2996,6 +2883,9 @@ struct __Pyx_CodeObjectCache __pyx_code_cache; PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; #endif +/* Generator.module_state_decls */ +PyTypeObject *__pyx_GeneratorType; + /* #### Code section: module_state_end ### */ } __pyx_mstatetype; @@ -3025,176 +2915,193 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_kp_u_Add_a_constraint_to_the_problem __pyx_string_tab[1] #define __pyx_kp_u_Add_a_variable_to_the_problem_Ex __pyx_string_tab[2] #define __pyx_kp_u_Add_one_or_more_variables_to_the __pyx_string_tab[3] -#define __pyx_n_u_AssertionError __pyx_string_tab[4] -#define __pyx_n_u_Callable __pyx_string_tab[5] -#define __pyx_kp_u_Change_the_problem_solver_curren __pyx_string_tab[6] -#define __pyx_kp_u_Class_used_to_define_a_problem_a __pyx_string_tab[7] -#define __pyx_n_u_CompilableFunctionConstraint __pyx_string_tab[8] -#define __pyx_n_u_Constraint __pyx_string_tab[9] -#define __pyx_kp_u_Constraints_must_be_instances_of __pyx_string_tab[10] -#define __pyx_n_u_Domain __pyx_string_tab[11] -#define __pyx_kp_u_Domain_is_empty __pyx_string_tab[12] -#define __pyx_kp_u_Domains_must_be_instances_of_sub __pyx_string_tab[13] -#define __pyx_kp_u_Expected_constraints_to_be_strin __pyx_string_tab[14] -#define __pyx_kp_u_Find_and_return_a_solution_to_th __pyx_string_tab[15] -#define __pyx_kp_u_Find_and_return_all_solutions_to __pyx_string_tab[16] -#define __pyx_n_u_FunctionConstraint __pyx_string_tab[17] -#define __pyx_n_u_Hashable __pyx_string_tab[18] -#define __pyx_n_u_ImportError __pyx_string_tab[19] -#define __pyx_kp_u_None __pyx_string_tab[20] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[21] -#define __pyx_kp_u_Obtain_the_problem_solver_curren __pyx_string_tab[22] -#define __pyx_n_u_OptimizedBacktrackingSolver __pyx_string_tab[23] -#define __pyx_n_u_Optional __pyx_string_tab[24] -#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[25] -#define __pyx_n_u_ParallelSolver __pyx_string_tab[26] -#define __pyx_kp_u_ParallelSolver_is_currently_expe __pyx_string_tab[27] -#define __pyx_n_u_Problem __pyx_string_tab[28] -#define __pyx_n_u_Problem___init __pyx_string_tab[29] -#define __pyx_n_u_Problem__getArgs __pyx_string_tab[30] -#define __pyx_n_u_Problem__getArgs_locals_genexpr __pyx_string_tab[31] -#define __pyx_n_u_Problem_addConstraint __pyx_string_tab[32] -#define __pyx_kp_u_Problem_addConstraint_line_139 __pyx_string_tab[33] -#define __pyx_n_u_Problem_addConstraint_locals_gen __pyx_string_tab[34] -#define __pyx_n_u_Problem_addVariable __pyx_string_tab[35] -#define __pyx_kp_u_Problem_addVariable_line_86 __pyx_string_tab[36] -#define __pyx_n_u_Problem_addVariables __pyx_string_tab[37] -#define __pyx_kp_u_Problem_addVariables_line_116 __pyx_string_tab[38] -#define __pyx_n_u_Problem_getSolution __pyx_string_tab[39] -#define __pyx_n_u_Problem_getSolutionIter __pyx_string_tab[40] -#define __pyx_kp_u_Problem_getSolutionIter_line_216 __pyx_string_tab[41] -#define __pyx_kp_u_Problem_getSolution_line_178 __pyx_string_tab[42] -#define __pyx_n_u_Problem_getSolutions __pyx_string_tab[43] -#define __pyx_n_u_Problem_getSolutionsAsListDict __pyx_string_tab[44] -#define __pyx_n_u_Problem_getSolutionsOrderedList __pyx_string_tab[45] -#define __pyx_n_u_Problem_getSolutionsOrderedList_2 __pyx_string_tab[46] -#define __pyx_kp_u_Problem_getSolutions_line_197 __pyx_string_tab[47] -#define __pyx_n_u_Problem_getSolver __pyx_string_tab[48] -#define __pyx_kp_u_Problem_getSolver_line_72 __pyx_string_tab[49] -#define __pyx_n_u_Problem_reset __pyx_string_tab[50] -#define __pyx_kp_u_Problem_reset_line_44 __pyx_string_tab[51] -#define __pyx_n_u_Problem_setSolver __pyx_string_tab[52] -#define __pyx_kp_u_Problem_setSolver_line_57 __pyx_string_tab[53] -#define __pyx_kp_u_Reset_the_current_problem_defini __pyx_string_tab[54] -#define __pyx_kp_u_Return_an_iterator_to_the_soluti __pyx_string_tab[55] -#define __pyx_n_u_Sequence __pyx_string_tab[56] -#define __pyx_n_u_Solver __pyx_string_tab[57] -#define __pyx_kp_u_Tried_to_insert_duplicated_varia __pyx_string_tab[58] -#define __pyx_n_u_TypeError __pyx_string_tab[59] -#define __pyx_n_u_Union __pyx_string_tab[60] -#define __pyx_kp_u_Union_Constraint_Callable_str __pyx_string_tab[61] -#define __pyx_kp_u_Using_the_ParallelSolver_in_Thre __pyx_string_tab[62] -#define __pyx_n_u_ValueError __pyx_string_tab[63] -#define __pyx_kp_u_You_have_used_FunctionConstraint __pyx_string_tab[64] -#define __pyx_kp_u__2 __pyx_string_tab[65] -#define __pyx_kp_u__3 __pyx_string_tab[66] -#define __pyx_n_u__6 __pyx_string_tab[67] -#define __pyx_n_u_addConstraint __pyx_string_tab[68] -#define __pyx_n_u_addVariable __pyx_string_tab[69] -#define __pyx_n_u_addVariables __pyx_string_tab[70] -#define __pyx_kp_u_add_note __pyx_string_tab[71] -#define __pyx_n_u_allvariables __pyx_string_tab[72] -#define __pyx_n_u_append __pyx_string_tab[73] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[74] -#define __pyx_n_u_bool __pyx_string_tab[75] -#define __pyx_n_u_c __pyx_string_tab[76] -#define __pyx_n_u_clear __pyx_string_tab[77] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[78] -#define __pyx_n_u_close __pyx_string_tab[79] -#define __pyx_n_u_collections_abc __pyx_string_tab[80] -#define __pyx_n_u_compile_to_constraints __pyx_string_tab[81] -#define __pyx_n_u_constraint __pyx_string_tab[82] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[83] -#define __pyx_n_u_constraint_domain __pyx_string_tab[84] -#define __pyx_n_u_constraint_parser __pyx_string_tab[85] -#define __pyx_n_u_constraint_problem __pyx_string_tab[86] -#define __pyx_kp_u_constraint_problem_py __pyx_string_tab[87] -#define __pyx_n_u_constraint_solvers __pyx_string_tab[88] -#define __pyx_n_u_constraints __pyx_string_tab[89] -#define __pyx_n_u_constraints_2 __pyx_string_tab[90] -#define __pyx_n_u_copy __pyx_string_tab[91] -#define __pyx_n_u_deepcopy __pyx_string_tab[92] -#define __pyx_kp_u_disable __pyx_string_tab[93] -#define __pyx_n_u_doc __pyx_string_tab[94] -#define __pyx_n_u_domain __pyx_string_tab[95] -#define __pyx_n_u_domains __pyx_string_tab[96] -#define __pyx_kp_u_duplicate_parameter_configurati __pyx_string_tab[97] -#define __pyx_kp_u_enable __pyx_string_tab[98] -#define __pyx_n_u_extend __pyx_string_tab[99] -#define __pyx_n_u_freethreading __pyx_string_tab[100] -#define __pyx_n_u_func __pyx_string_tab[101] -#define __pyx_kp_u_gc __pyx_string_tab[102] -#define __pyx_n_u_genexpr __pyx_string_tab[103] -#define __pyx_n_u_getArgs __pyx_string_tab[104] -#define __pyx_n_u_getSolution __pyx_string_tab[105] -#define __pyx_n_u_getSolutionIter __pyx_string_tab[106] -#define __pyx_n_u_getSolutions __pyx_string_tab[107] -#define __pyx_n_u_getSolutionsAsListDict __pyx_string_tab[108] -#define __pyx_n_u_getSolutionsOrderedList __pyx_string_tab[109] -#define __pyx_n_u_getSolver __pyx_string_tab[110] -#define __pyx_n_u_get_in_order __pyx_string_tab[111] -#define __pyx_n_u_getitem __pyx_string_tab[112] -#define __pyx_n_u_init __pyx_string_tab[113] -#define __pyx_n_u_initializing __pyx_string_tab[114] -#define __pyx_n_u_is_coroutine __pyx_string_tab[115] -#define __pyx_n_u_is_gil_enabled __pyx_string_tab[116] -#define __pyx_kp_u_isenabled __pyx_string_tab[117] -#define __pyx_n_u_itemgetter __pyx_string_tab[118] -#define __pyx_n_u_keys __pyx_string_tab[119] -#define __pyx_kp_u_list_str __pyx_string_tab[120] -#define __pyx_kp_u_list_tuple __pyx_string_tab[121] -#define __pyx_n_u_main __pyx_string_tab[122] -#define __pyx_n_u_metaclass __pyx_string_tab[123] -#define __pyx_n_u_module __pyx_string_tab[124] -#define __pyx_n_u_msg __pyx_string_tab[125] -#define __pyx_n_u_name __pyx_string_tab[126] -#define __pyx_n_u_next __pyx_string_tab[127] -#define __pyx_n_u_operator __pyx_string_tab[128] -#define __pyx_n_u_order __pyx_string_tab[129] -#define __pyx_n_u_params __pyx_string_tab[130] -#define __pyx_n_u_parsed __pyx_string_tab[131] -#define __pyx_n_u_picklable __pyx_string_tab[132] -#define __pyx_n_u_pop __pyx_string_tab[133] -#define __pyx_n_u_preProcess __pyx_string_tab[134] -#define __pyx_n_u_prepare __pyx_string_tab[135] -#define __pyx_n_u_process_mode __pyx_string_tab[136] -#define __pyx_n_u_qualname __pyx_string_tab[137] -#define __pyx_n_u_range __pyx_string_tab[138] -#define __pyx_n_u_requires_pickling __pyx_string_tab[139] -#define __pyx_n_u_reset __pyx_string_tab[140] -#define __pyx_n_u_resetState __pyx_string_tab[141] -#define __pyx_n_u_return __pyx_string_tab[142] -#define __pyx_n_u_self __pyx_string_tab[143] -#define __pyx_n_u_send __pyx_string_tab[144] -#define __pyx_n_u_setSolver __pyx_string_tab[145] -#define __pyx_n_u_set_name __pyx_string_tab[146] -#define __pyx_n_u_size_dict __pyx_string_tab[147] -#define __pyx_n_u_size_list __pyx_string_tab[148] -#define __pyx_n_u_solution __pyx_string_tab[149] -#define __pyx_n_u_solutions __pyx_string_tab[150] -#define __pyx_n_u_solutions_dict __pyx_string_tab[151] -#define __pyx_n_u_solutions_list __pyx_string_tab[152] -#define __pyx_n_u_solver __pyx_string_tab[153] -#define __pyx_n_u_solver_2 __pyx_string_tab[154] -#define __pyx_kp_u_solver_is_not_instance_of_Solve __pyx_string_tab[155] -#define __pyx_n_u_spec __pyx_string_tab[156] -#define __pyx_n_u_str_constraints __pyx_string_tab[157] -#define __pyx_n_u_sys __pyx_string_tab[158] -#define __pyx_n_u_test __pyx_string_tab[159] -#define __pyx_n_u_throw __pyx_string_tab[160] -#define __pyx_kp_u_tuple_list_tuple_dict_tuple_int __pyx_string_tab[161] -#define __pyx_n_u_typing __pyx_string_tab[162] -#define __pyx_n_u_v __pyx_string_tab[163] -#define __pyx_n_u_validate __pyx_string_tab[164] -#define __pyx_n_u_value __pyx_string_tab[165] -#define __pyx_n_u_values __pyx_string_tab[166] -#define __pyx_n_u_variable __pyx_string_tab[167] -#define __pyx_n_u_variables __pyx_string_tab[168] -#define __pyx_n_u_variables_2 __pyx_string_tab[169] -#define __pyx_n_u_vconstraints __pyx_string_tab[170] -#define __pyx_n_u_warn __pyx_string_tab[171] -#define __pyx_n_u_warnings __pyx_string_tab[172] -#define __pyx_n_u_zip __pyx_string_tab[173] +#define __pyx_kp_u_Change_the_problem_solver_curren __pyx_string_tab[4] +#define __pyx_kp_u_Class_used_to_define_a_problem_a __pyx_string_tab[5] +#define __pyx_kp_u_Constraint_Callable_str __pyx_string_tab[6] +#define __pyx_kp_u_Constraints __pyx_string_tab[7] +#define __pyx_kp_u_Constraints_must_be_instances_of __pyx_string_tab[8] +#define __pyx_kp_u_Domain_is_empty __pyx_string_tab[9] +#define __pyx_kp_u_Domains_must_be_instances_of_sub __pyx_string_tab[10] +#define __pyx_kp_u_Duplicate_configs __pyx_string_tab[11] +#define __pyx_kp_u_Expected_constraints_to_be_strin __pyx_string_tab[12] +#define __pyx_kp_u_Find_and_return_a_solution_to_th __pyx_string_tab[13] +#define __pyx_kp_u_Find_and_return_all_solutions_to __pyx_string_tab[14] +#define __pyx_kp_u_None __pyx_string_tab[15] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[16] +#define __pyx_kp_u_Obtain_the_problem_solver_curren __pyx_string_tab[17] +#define __pyx_kp_u_ParallelSolver_is_currently_expe __pyx_string_tab[18] +#define __pyx_kp_u_Problem_addConstraint_line_140 __pyx_string_tab[19] +#define __pyx_kp_u_Problem_addVariable_line_85 __pyx_string_tab[20] +#define __pyx_kp_u_Problem_addVariables_line_117 __pyx_string_tab[21] +#define __pyx_kp_u_Problem_getSolutionIter_line_217 __pyx_string_tab[22] +#define __pyx_kp_u_Problem_getSolution_line_179 __pyx_string_tab[23] +#define __pyx_kp_u_Problem_getSolutions_line_198 __pyx_string_tab[24] +#define __pyx_kp_u_Problem_getSolver_line_71 __pyx_string_tab[25] +#define __pyx_kp_u_Problem_reset_line_43 __pyx_string_tab[26] +#define __pyx_kp_u_Problem_setSolver_line_56 __pyx_string_tab[27] +#define __pyx_kp_u_Reset_the_current_problem_defini __pyx_string_tab[28] +#define __pyx_kp_u_Return_an_iterator_to_the_soluti __pyx_string_tab[29] +#define __pyx_kp_u_Sequence_None __pyx_string_tab[30] +#define __pyx_kp_u_Tried_to_insert_duplicated_varia __pyx_string_tab[31] +#define __pyx_kp_u_Using_the_ParallelSolver_in_Thre __pyx_string_tab[32] +#define __pyx_kp_u_You_have_used_FunctionConstraint __pyx_string_tab[33] +#define __pyx_kp_u__2 __pyx_string_tab[34] +#define __pyx_kp_u__3 __pyx_string_tab[35] +#define __pyx_kp_u__4 __pyx_string_tab[36] +#define __pyx_kp_u_add_note __pyx_string_tab[37] +#define __pyx_kp_u_constraint_problem_py __pyx_string_tab[38] +#define __pyx_kp_u_disable __pyx_string_tab[39] +#define __pyx_kp_u_duplicate_parameter_configurati __pyx_string_tab[40] +#define __pyx_kp_u_enable __pyx_string_tab[41] +#define __pyx_kp_u_gc __pyx_string_tab[42] +#define __pyx_kp_u_isenabled __pyx_string_tab[43] +#define __pyx_kp_u_list_str __pyx_string_tab[44] +#define __pyx_kp_u_list_tuple __pyx_string_tab[45] +#define __pyx_kp_u_solver_is_not_instance_of_Solve __pyx_string_tab[46] +#define __pyx_kp_u_tuple_list_tuple_dict_tuple_int __pyx_string_tab[47] +#define __pyx_kp_u_unique __pyx_string_tab[48] +#define __pyx_n_u_Callable __pyx_string_tab[49] +#define __pyx_n_u_CompilableFunctionConstraint __pyx_string_tab[50] +#define __pyx_n_u_Constraint __pyx_string_tab[51] +#define __pyx_n_u_Domain __pyx_string_tab[52] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[53] +#define __pyx_n_u_Hashable __pyx_string_tab[54] +#define __pyx_n_u_OptimizedBacktrackingSolver __pyx_string_tab[55] +#define __pyx_n_u_ParallelSolver __pyx_string_tab[56] +#define __pyx_n_u_Problem __pyx_string_tab[57] +#define __pyx_n_u_Problem___init __pyx_string_tab[58] +#define __pyx_n_u_Problem__getArgs __pyx_string_tab[59] +#define __pyx_n_u_Problem__getArgs_locals_genexpr __pyx_string_tab[60] +#define __pyx_n_u_Problem_addConstraint __pyx_string_tab[61] +#define __pyx_n_u_Problem_addConstraint_locals_gen __pyx_string_tab[62] +#define __pyx_n_u_Problem_addVariable __pyx_string_tab[63] +#define __pyx_n_u_Problem_addVariables __pyx_string_tab[64] +#define __pyx_n_u_Problem_getSolution __pyx_string_tab[65] +#define __pyx_n_u_Problem_getSolutionIter __pyx_string_tab[66] +#define __pyx_n_u_Problem_getSolutions __pyx_string_tab[67] +#define __pyx_n_u_Problem_getSolutionsAsListDict __pyx_string_tab[68] +#define __pyx_n_u_Problem_getSolutionsOrderedList __pyx_string_tab[69] +#define __pyx_n_u_Problem_getSolutionsOrderedList_2 __pyx_string_tab[70] +#define __pyx_n_u_Problem_getSolver __pyx_string_tab[71] +#define __pyx_n_u_Problem_reset __pyx_string_tab[72] +#define __pyx_n_u_Problem_setSolver __pyx_string_tab[73] +#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[74] +#define __pyx_n_u_Sequence __pyx_string_tab[75] +#define __pyx_n_u_Solver __pyx_string_tab[76] +#define __pyx_n_u__7 __pyx_string_tab[77] +#define __pyx_n_u_addConstraint __pyx_string_tab[78] +#define __pyx_n_u_addVariable __pyx_string_tab[79] +#define __pyx_n_u_addVariables __pyx_string_tab[80] +#define __pyx_n_u_allvariables __pyx_string_tab[81] +#define __pyx_n_u_annotate __pyx_string_tab[82] +#define __pyx_n_u_append __pyx_string_tab[83] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[84] +#define __pyx_n_u_bool __pyx_string_tab[85] +#define __pyx_n_u_c __pyx_string_tab[86] +#define __pyx_n_u_clear __pyx_string_tab[87] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[88] +#define __pyx_n_u_close __pyx_string_tab[89] +#define __pyx_n_u_collections_abc __pyx_string_tab[90] +#define __pyx_n_u_compile_to_constraints __pyx_string_tab[91] +#define __pyx_n_u_constraint __pyx_string_tab[92] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[93] +#define __pyx_n_u_constraint_domain __pyx_string_tab[94] +#define __pyx_n_u_constraint_parser __pyx_string_tab[95] +#define __pyx_n_u_constraint_problem __pyx_string_tab[96] +#define __pyx_n_u_constraint_solvers __pyx_string_tab[97] +#define __pyx_n_u_constraints __pyx_string_tab[98] +#define __pyx_n_u_constraints_2 __pyx_string_tab[99] +#define __pyx_n_u_copy __pyx_string_tab[100] +#define __pyx_n_u_count __pyx_string_tab[101] +#define __pyx_n_u_deepcopy __pyx_string_tab[102] +#define __pyx_n_u_doc __pyx_string_tab[103] +#define __pyx_n_u_domain __pyx_string_tab[104] +#define __pyx_n_u_domains __pyx_string_tab[105] +#define __pyx_n_u_extend __pyx_string_tab[106] +#define __pyx_n_u_freethreading __pyx_string_tab[107] +#define __pyx_n_u_func __pyx_string_tab[108] +#define __pyx_n_u_genexpr __pyx_string_tab[109] +#define __pyx_n_u_getArgs __pyx_string_tab[110] +#define __pyx_n_u_getSolution __pyx_string_tab[111] +#define __pyx_n_u_getSolutionIter __pyx_string_tab[112] +#define __pyx_n_u_getSolutions __pyx_string_tab[113] +#define __pyx_n_u_getSolutionsAsListDict __pyx_string_tab[114] +#define __pyx_n_u_getSolutionsOrderedList __pyx_string_tab[115] +#define __pyx_n_u_getSolver __pyx_string_tab[116] +#define __pyx_n_u_get_in_order __pyx_string_tab[117] +#define __pyx_n_u_getitem __pyx_string_tab[118] +#define __pyx_n_u_init __pyx_string_tab[119] +#define __pyx_n_u_is_coroutine __pyx_string_tab[120] +#define __pyx_n_u_is_gil_enabled __pyx_string_tab[121] +#define __pyx_n_u_itemgetter __pyx_string_tab[122] +#define __pyx_n_u_items __pyx_string_tab[123] +#define __pyx_n_u_keys __pyx_string_tab[124] +#define __pyx_n_u_main __pyx_string_tab[125] +#define __pyx_n_u_metaclass __pyx_string_tab[126] +#define __pyx_n_u_module __pyx_string_tab[127] +#define __pyx_n_u_msg __pyx_string_tab[128] +#define __pyx_n_u_name __pyx_string_tab[129] +#define __pyx_n_u_next __pyx_string_tab[130] +#define __pyx_n_u_operator __pyx_string_tab[131] +#define __pyx_n_u_order __pyx_string_tab[132] +#define __pyx_n_u_params __pyx_string_tab[133] +#define __pyx_n_u_parsed __pyx_string_tab[134] +#define __pyx_n_u_picklable __pyx_string_tab[135] +#define __pyx_n_u_pop __pyx_string_tab[136] +#define __pyx_n_u_preProcess __pyx_string_tab[137] +#define __pyx_n_u_prepare __pyx_string_tab[138] +#define __pyx_n_u_process_mode __pyx_string_tab[139] +#define __pyx_n_u_qualname __pyx_string_tab[140] +#define __pyx_n_u_requires_pickling __pyx_string_tab[141] +#define __pyx_n_u_reset __pyx_string_tab[142] +#define __pyx_n_u_resetState __pyx_string_tab[143] +#define __pyx_n_u_return __pyx_string_tab[144] +#define __pyx_n_u_self __pyx_string_tab[145] +#define __pyx_n_u_send __pyx_string_tab[146] +#define __pyx_n_u_setSolver __pyx_string_tab[147] +#define __pyx_n_u_set_name __pyx_string_tab[148] +#define __pyx_n_u_setdefault __pyx_string_tab[149] +#define __pyx_n_u_size_dict __pyx_string_tab[150] +#define __pyx_n_u_size_list __pyx_string_tab[151] +#define __pyx_n_u_solution __pyx_string_tab[152] +#define __pyx_n_u_solutions __pyx_string_tab[153] +#define __pyx_n_u_solutions_dict __pyx_string_tab[154] +#define __pyx_n_u_solutions_list __pyx_string_tab[155] +#define __pyx_n_u_solver __pyx_string_tab[156] +#define __pyx_n_u_solver_2 __pyx_string_tab[157] +#define __pyx_n_u_str_constraints __pyx_string_tab[158] +#define __pyx_n_u_sys __pyx_string_tab[159] +#define __pyx_n_u_test __pyx_string_tab[160] +#define __pyx_n_u_throw __pyx_string_tab[161] +#define __pyx_n_u_v __pyx_string_tab[162] +#define __pyx_n_u_validate __pyx_string_tab[163] +#define __pyx_n_u_value __pyx_string_tab[164] +#define __pyx_n_u_values __pyx_string_tab[165] +#define __pyx_n_u_variable __pyx_string_tab[166] +#define __pyx_n_u_variables __pyx_string_tab[167] +#define __pyx_n_u_variables_2 __pyx_string_tab[168] +#define __pyx_n_u_vconstraints __pyx_string_tab[169] +#define __pyx_n_u_warn __pyx_string_tab[170] +#define __pyx_n_u_warnings __pyx_string_tab[171] +#define __pyx_n_u_zip __pyx_string_tab[172] +#define __pyx_kp_b_iso88591_A_9Ct1_8_Qa_AQ_4z_V7_4t7_8ST_T __pyx_string_tab[173] +#define __pyx_kp_b_iso88591_A_D_Q_KvQ __pyx_string_tab[174] +#define __pyx_kp_b_iso88591_A_Kq __pyx_string_tab[175] +#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_1_t8_q __pyx_string_tab[176] +#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_1_t8_q_a __pyx_string_tab[177] +#define __pyx_kp_b_iso88591_A_oT_T_QR_4q_4q_t8_1I __pyx_string_tab[178] +#define __pyx_kp_b_iso88591_A_t1 __pyx_string_tab[179] +#define __pyx_kp_b_iso88591_A_z_5Qa_Cq_t1Cq_8_Qa_1_1A_z_A_j __pyx_string_tab[180] +#define __pyx_kp_b_iso88591_E_PQ_Ql_q_A_jjkkl_4z_a_xq_q_1L __pyx_string_tab[181] +#define __pyx_kp_b_iso88591_Q __pyx_string_tab[182] +#define __pyx_kp_b_iso88591_Q_2 __pyx_string_tab[183] +#define __pyx_kp_b_iso88591__5 __pyx_string_tab[184] +#define __pyx_kp_b_iso88591__6 __pyx_string_tab[185] +#define __pyx_kp_b_iso88591_a_L_AZq __pyx_string_tab[186] +#define __pyx_kp_b_iso88591_g_B_M_6_E_Cq_s_vQ_z_1 __pyx_string_tab[187] +#define __pyx_kp_b_iso88591_q_k_a_we1_5Q_3at_b_d_q_izQR_Cs __pyx_string_tab[188] +#define __pyx_kp_b_iso88591_xq_Kwc_A_1_2_z_j_1_aaeeffjjk_Qd __pyx_string_tab[189] +#define __pyx_int_1 __pyx_number_tab[0] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3206,12 +3113,6 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif #if CYTHON_PEP489_MULTI_PHASE_INIT __Pyx_State_RemoveModule(NULL); #endif @@ -3226,10 +3127,22 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr); for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } - for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } + for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } for (int i=0; i<17; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<174; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } - return 0; + for (int i=0; i<190; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); } +/* #### Code section: module_state_clear_contents ### */ +/* CommonTypesMetaclass.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType); + +/* CythonFunctionShared.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + +/* Generator.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_GeneratorType); + +/* #### Code section: module_state_clear_end ### */ +return 0; } #endif /* #### Code section: module_state_traverse ### */ @@ -3243,12 +3156,6 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); - #endif Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList); @@ -3260,15 +3167,27 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr); for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } - for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } + for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } for (int i=0; i<17; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<174; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } - return 0; + for (int i=0; i<190; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); } +/* #### Code section: module_state_traverse_contents ### */ +/* CommonTypesMetaclass.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType); + +/* CythonFunctionShared.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + +/* Generator.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_GeneratorType); + +/* #### Code section: module_state_traverse_end ### */ +return 0; } #endif /* #### Code section: module_code ### */ -/* "constraint/problem.py":24 +/* "constraint/problem.py":23 * """Class used to define a problem and retrieve solutions.""" * * def __init__(self, solver: Solver=None): # <<<<<<<<<<<<<< @@ -3317,35 +3236,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_solver,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 24, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 23, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 24, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 23, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 24, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 23, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 24, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 23, __pyx_L3_error) if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(0, 24, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(0, 23, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 24, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 23, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 24, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 23, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -3356,7 +3275,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 24, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 23, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3394,14 +3313,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/problem.py":30 + /* "constraint/problem.py":29 * solver (instance of a :py:class:`Solver`): Problem solver (default :py:class:`OptimizedBacktrackingSolver`) * """ * self._solver = solver or OptimizedBacktrackingSolver() # <<<<<<<<<<<<<< * self._constraints: list[tuple[Constraint, any]] = [] * self._str_constraints: list[str] = [] */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_solver); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_solver); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 29, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_solver); @@ -3409,7 +3328,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED goto __pyx_L3_bool_binop_done; } __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -3425,56 +3344,56 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L3_bool_binop_done:; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2, __pyx_t_1) < (0)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":31 + /* "constraint/problem.py":30 * """ * self._solver = solver or OptimizedBacktrackingSolver() * self._constraints: list[tuple[Constraint, any]] = [] # <<<<<<<<<<<<<< * self._str_constraints: list[str] = [] * self._variables: dict[Hashable, Domain] = {} */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_t_1) < (0)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":32 + /* "constraint/problem.py":31 * self._solver = solver or OptimizedBacktrackingSolver() * self._constraints: list[tuple[Constraint, any]] = [] * self._str_constraints: list[str] = [] # <<<<<<<<<<<<<< * self._variables: dict[Hashable, Domain] = {} * */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints, __pyx_t_1) < (0)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":33 + /* "constraint/problem.py":32 * self._constraints: list[tuple[Constraint, any]] = [] * self._str_constraints: list[str] = [] * self._variables: dict[Hashable, Domain] = {} # <<<<<<<<<<<<<< * * # check if solver is instance instead of class */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables, __pyx_t_1) < (0)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":36 + /* "constraint/problem.py":35 * * # check if solver is instance instead of class * assert isinstance(self._solver, Solver), f"`solver` is not instance of Solver class (is {type(self._solver)})." # <<<<<<<<<<<<<< @@ -3483,52 +3402,52 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_IsInstance(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_2 = PyObject_IsInstance(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_t_3)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_t_3)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_solver_is_not_instance_of_Solve; __pyx_t_7[1] = __pyx_t_1; __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_; __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, 45 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1)); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_3, 0, 0); + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 36, __pyx_L1_error) + __PYX_ERR(0, 35, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 36, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 35, __pyx_L1_error) #endif - /* "constraint/problem.py":39 + /* "constraint/problem.py":38 * * # warn for experimental parallel solver * if isinstance(self._solver, ParallelSolver): # <<<<<<<<<<<<<< * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 * if not self._solver._process_mode and not freethreading: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ParallelSolver); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ParallelSolver); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_t_3, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_2 = PyObject_IsInstance(__pyx_t_3, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/problem.py":40 + /* "constraint/problem.py":39 * # warn for experimental parallel solver * if isinstance(self._solver, ParallelSolver): * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 # <<<<<<<<<<<<<< @@ -3536,7 +3455,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") */ __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -3552,27 +3471,27 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_ParallelSolver_is_currently_expe}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":41 + /* "constraint/problem.py":40 * if isinstance(self._solver, ParallelSolver): * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 * if not self._solver._process_mode and not freethreading: # <<<<<<<<<<<<<< * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_process_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_process_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = (!__pyx_t_8); if (__pyx_t_9) { @@ -3580,16 +3499,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED __pyx_t_2 = __pyx_t_9; goto __pyx_L7_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_freethreading); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_freethreading); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_8 = (!__pyx_t_9); __pyx_t_2 = __pyx_t_8; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { - /* "constraint/problem.py":42 + /* "constraint/problem.py":41 * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 * if not self._solver._process_mode and not freethreading: * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") # <<<<<<<<<<<<<< @@ -3597,7 +3516,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED * def reset(self): */ __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -3613,15 +3532,15 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Using_the_ParallelSolver_in_Thre}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/problem.py":41 + /* "constraint/problem.py":40 * if isinstance(self._solver, ParallelSolver): * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 * if not self._solver._process_mode and not freethreading: # <<<<<<<<<<<<<< @@ -3630,7 +3549,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED */ } - /* "constraint/problem.py":39 + /* "constraint/problem.py":38 * * # warn for experimental parallel solver * if isinstance(self._solver, ParallelSolver): # <<<<<<<<<<<<<< @@ -3639,7 +3558,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED */ } - /* "constraint/problem.py":24 + /* "constraint/problem.py":23 * """Class used to define a problem and retrieve solutions.""" * * def __init__(self, solver: Solver=None): # <<<<<<<<<<<<<< @@ -3663,7 +3582,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED return __pyx_r; } -/* "constraint/problem.py":44 +/* "constraint/problem.py":43 * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") * * def reset(self): # <<<<<<<<<<<<<< @@ -3711,32 +3630,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 44, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 43, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 44, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 43, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reset", 0) < 0) __PYX_ERR(0, 44, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reset", 0) < (0)) __PYX_ERR(0, 43, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reset", 1, 1, 1, i); __PYX_ERR(0, 44, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reset", 1, 1, 1, i); __PYX_ERR(0, 43, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 44, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 43, __pyx_L3_error) } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("reset", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 44, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("reset", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 43, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3769,41 +3688,41 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED Py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 0); - /* "constraint/problem.py":54 + /* "constraint/problem.py":53 * >>> * """ * del self._constraints[:] # <<<<<<<<<<<<<< * self._variables.clear() * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_DelSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + if (__Pyx_PyObject_DelSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < (0)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":55 + /* "constraint/problem.py":54 * """ * del self._constraints[:] * self._variables.clear() # <<<<<<<<<<<<<< * * def setSolver(self, solver): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_clear, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":44 + /* "constraint/problem.py":43 * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") * * def reset(self): # <<<<<<<<<<<<<< @@ -3826,7 +3745,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED Py return __pyx_r; } -/* "constraint/problem.py":57 +/* "constraint/problem.py":56 * self._variables.clear() * * def setSolver(self, solver): # <<<<<<<<<<<<<< @@ -3875,39 +3794,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_solver,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 57, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 56, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 57, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 56, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 57, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 56, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSolver", 0) < 0) __PYX_ERR(0, 57, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSolver", 0) < (0)) __PYX_ERR(0, 56, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSolver", 1, 2, 2, i); __PYX_ERR(0, 57, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSolver", 1, 2, 2, i); __PYX_ERR(0, 56, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 57, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 56, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 57, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 56, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_solver = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("setSolver", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 57, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setSolver", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 56, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3936,16 +3855,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_4setSolver(CYTHON_UNUSE int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSolver", 0); - /* "constraint/problem.py":70 + /* "constraint/problem.py":69 * solver * """ * self._solver = solver # <<<<<<<<<<<<<< * * def getSolver(self): */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2, __pyx_v_solver) < 0) __PYX_ERR(0, 70, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2, __pyx_v_solver) < (0)) __PYX_ERR(0, 69, __pyx_L1_error) - /* "constraint/problem.py":57 + /* "constraint/problem.py":56 * self._variables.clear() * * def setSolver(self, solver): # <<<<<<<<<<<<<< @@ -3965,7 +3884,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_4setSolver(CYTHON_UNUSE return __pyx_r; } -/* "constraint/problem.py":72 +/* "constraint/problem.py":71 * self._solver = solver * * def getSolver(self): # <<<<<<<<<<<<<< @@ -4013,32 +3932,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 72, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 71, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 72, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 71, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolver", 0) < 0) __PYX_ERR(0, 72, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolver", 0) < (0)) __PYX_ERR(0, 71, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolver", 1, 1, 1, i); __PYX_ERR(0, 72, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolver", 1, 1, 1, i); __PYX_ERR(0, 71, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 72, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 71, __pyx_L3_error) } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getSolver", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getSolver", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 71, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4068,7 +3987,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_6getSolver(CYTHON_UNUSE int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolver", 0); - /* "constraint/problem.py":84 + /* "constraint/problem.py":83 * instance of a :py:class:`Solver` subclass: Solver currently in use * """ * return self._solver # <<<<<<<<<<<<<< @@ -4076,13 +3995,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_6getSolver(CYTHON_UNUSE * def addVariable(self, variable: Hashable, domain): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":72 + /* "constraint/problem.py":71 * self._solver = solver * * def getSolver(self): # <<<<<<<<<<<<<< @@ -4101,7 +4020,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_6getSolver(CYTHON_UNUSE return __pyx_r; } -/* "constraint/problem.py":86 +/* "constraint/problem.py":85 * return self._solver * * def addVariable(self, variable: Hashable, domain): # <<<<<<<<<<<<<< @@ -4117,7 +4036,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10constraint_7problem_7Problem_8addVariable, "Add a variable to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariable(\"a\", [1, 2])\n >>> problem.getSolution() in ({'a': 1}, {'a': 2})\n True\n\n Args:\n variable (hashable object): Object representing a problem\n variable\n domain (list, tuple, or instance of :py:class:`Domain`): Set of items\n defining the possible values that the given variable may\n assume\n "); +PyDoc_STRVAR(__pyx_doc_10constraint_7problem_7Problem_8addVariable, "Add a variable to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariable(\"a\", [1, 2])\n >>> problem.getSolution() in ({'a': 1}, {'a': 2})\n True\n\n Args:\n variable (hashable object): Object representing a problem\n variable\n domain (list, tuple, set, or instance of :py:class:`Domain`): Set of items\n defining the possible values that the given variable may\n assume\n "); static PyMethodDef __pyx_mdef_10constraint_7problem_7Problem_9addVariable = {"addVariable", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10constraint_7problem_7Problem_9addVariable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10constraint_7problem_7Problem_8addVariable}; static PyObject *__pyx_pw_10constraint_7problem_7Problem_9addVariable(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -4151,38 +4070,38 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variable,&__pyx_mstate_global->__pyx_n_u_domain,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 86, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 85, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 86, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 85, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 86, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 85, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 86, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 85, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addVariable", 0) < 0) __PYX_ERR(0, 86, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addVariable", 0) < (0)) __PYX_ERR(0, 85, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addVariable", 1, 3, 3, i); __PYX_ERR(0, 86, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addVariable", 1, 3, 3, i); __PYX_ERR(0, 85, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 86, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 85, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 86, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 85, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 86, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 85, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variable = values[1]; @@ -4190,7 +4109,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("addVariable", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 86, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addVariable", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 85, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4218,71 +4137,69 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - size_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; + size_t __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addVariable", 0); __Pyx_INCREF(__pyx_v_domain); - /* "constraint/problem.py":102 + /* "constraint/problem.py":101 * assume * """ * if variable in self._variables: # <<<<<<<<<<<<<< * msg = f"Tried to insert duplicated variable {repr(variable)}" * raise ValueError(msg) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { - /* "constraint/problem.py":103 + /* "constraint/problem.py":102 * """ * if variable in self._variables: * msg = f"Tried to insert duplicated variable {repr(variable)}" # <<<<<<<<<<<<<< * raise ValueError(msg) - * if isinstance(domain, Domain): + * if not isinstance(variable, (list, tuple, Domain)) and not hasattr(domain, "__getitem__"): */ - __pyx_t_1 = PyObject_Repr(__pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_1 = PyObject_Repr(__pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Tried_to_insert_duplicated_varia, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Tried_to_insert_duplicated_varia, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":104 + /* "constraint/problem.py":103 * if variable in self._variables: * msg = f"Tried to insert duplicated variable {repr(variable)}" * raise ValueError(msg) # <<<<<<<<<<<<<< - * if isinstance(domain, Domain): - * domain = copy.deepcopy(domain) + * if not isinstance(variable, (list, tuple, Domain)) and not hasattr(domain, "__getitem__"): + * domain = list(domain) */ __pyx_t_3 = NULL; - __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_4 = __pyx_builtin_ValueError; - __pyx_t_5 = 1; + __pyx_t_4 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_msg}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 104, __pyx_L1_error) + __PYX_ERR(0, 103, __pyx_L1_error) - /* "constraint/problem.py":102 + /* "constraint/problem.py":101 * assume * """ * if variable in self._variables: # <<<<<<<<<<<<<< @@ -4291,119 +4208,177 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU */ } - /* "constraint/problem.py":105 + /* "constraint/problem.py":104 * msg = f"Tried to insert duplicated variable {repr(variable)}" * raise ValueError(msg) - * if isinstance(domain, Domain): # <<<<<<<<<<<<<< - * domain = copy.deepcopy(domain) - * elif hasattr(domain, "__getitem__"): + * if not isinstance(variable, (list, tuple, Domain)) and not hasattr(domain, "__getitem__"): # <<<<<<<<<<<<<< + * domain = list(domain) + * if isinstance(domain, Domain): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_domain, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_6 = PyList_Check(__pyx_v_variable); + if (!__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_6 = PyTuple_Check(__pyx_v_variable); + if (!__pyx_t_6) { + } else { + __pyx_t_5 = __pyx_t_6; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_6 = PyObject_IsInstance(__pyx_v_variable, __pyx_t_1); + __pyx_t_5 = __pyx_t_6; + __pyx_L7_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { + } else { + __pyx_t_2 = __pyx_t_6; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_6 = __Pyx_HasAttr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_getitem); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_5 = (!__pyx_t_6); + __pyx_t_2 = __pyx_t_5; + __pyx_L5_bool_binop_done:; if (__pyx_t_2) { - /* "constraint/problem.py":106 + /* "constraint/problem.py":105 * raise ValueError(msg) + * if not isinstance(variable, (list, tuple, Domain)) and not hasattr(domain, "__getitem__"): + * domain = list(domain) # <<<<<<<<<<<<<< * if isinstance(domain, Domain): - * domain = copy.deepcopy(domain) # <<<<<<<<<<<<<< - * elif hasattr(domain, "__getitem__"): - * domain = Domain(domain) + * domain = copy.deepcopy(domain) */ - __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_deepcopy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 106, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = 1; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); - assert(__pyx_t_4); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = PySequence_List(__pyx_v_domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; + + /* "constraint/problem.py":104 + * msg = f"Tried to insert duplicated variable {repr(variable)}" + * raise ValueError(msg) + * if not isinstance(variable, (list, tuple, Domain)) and not hasattr(domain, "__getitem__"): # <<<<<<<<<<<<<< + * domain = list(domain) + * if isinstance(domain, Domain): +*/ + } + + /* "constraint/problem.py":106 + * if not isinstance(variable, (list, tuple, Domain)) and not hasattr(domain, "__getitem__"): + * domain = list(domain) + * if isinstance(domain, Domain): # <<<<<<<<<<<<<< + * domain = copy.deepcopy(domain) + * elif hasattr(domain, "__getitem__"): +*/ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_IsInstance(__pyx_v_domain, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "constraint/problem.py":107 + * domain = list(domain) + * if isinstance(domain, Domain): + * domain = copy.deepcopy(domain) # <<<<<<<<<<<<<< + * elif hasattr(domain, "__getitem__"): + * domain = Domain(domain) +*/ + __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_deepcopy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_4 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_3); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __pyx_t_4 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_domain}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_domain}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":105 - * msg = f"Tried to insert duplicated variable {repr(variable)}" - * raise ValueError(msg) + /* "constraint/problem.py":106 + * if not isinstance(variable, (list, tuple, Domain)) and not hasattr(domain, "__getitem__"): + * domain = list(domain) * if isinstance(domain, Domain): # <<<<<<<<<<<<<< * domain = copy.deepcopy(domain) * elif hasattr(domain, "__getitem__"): */ - goto __pyx_L4; + goto __pyx_L10; } - /* "constraint/problem.py":107 + /* "constraint/problem.py":108 * if isinstance(domain, Domain): * domain = copy.deepcopy(domain) * elif hasattr(domain, "__getitem__"): # <<<<<<<<<<<<<< * domain = Domain(domain) * else: */ - __pyx_t_2 = __Pyx_HasAttr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_getitem); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_2 = __Pyx_HasAttr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_getitem); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 108, __pyx_L1_error) if (likely(__pyx_t_2)) { - /* "constraint/problem.py":108 + /* "constraint/problem.py":109 * domain = copy.deepcopy(domain) * elif hasattr(domain, "__getitem__"): * domain = Domain(domain) # <<<<<<<<<<<<<< * else: * msg = "Domains must be instances of subclasses of the Domain class" */ - __pyx_t_6 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = 1; + __pyx_t_8 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - assert(__pyx_t_6); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); + assert(__pyx_t_8); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); - __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_t_3, __pyx__function); + __pyx_t_4 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_domain}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_domain}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":107 + /* "constraint/problem.py":108 * if isinstance(domain, Domain): * domain = copy.deepcopy(domain) * elif hasattr(domain, "__getitem__"): # <<<<<<<<<<<<<< * domain = Domain(domain) * else: */ - goto __pyx_L4; + goto __pyx_L10; } - /* "constraint/problem.py":110 + /* "constraint/problem.py":111 * domain = Domain(domain) * else: * msg = "Domains must be instances of subclasses of the Domain class" # <<<<<<<<<<<<<< @@ -4414,66 +4389,60 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Domains_must_be_instances_of_sub); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_Domains_must_be_instances_of_sub; - /* "constraint/problem.py":111 + /* "constraint/problem.py":112 * else: * msg = "Domains must be instances of subclasses of the Domain class" * raise TypeError(msg) # <<<<<<<<<<<<<< * if not domain: * raise ValueError("Domain is empty") */ - __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_TypeError); - __pyx_t_6 = __pyx_builtin_TypeError; - __pyx_t_5 = 1; + __pyx_t_3 = NULL; + __pyx_t_4 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_msg}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_msg}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 111, __pyx_L1_error) + __PYX_ERR(0, 112, __pyx_L1_error) } - __pyx_L4:; + __pyx_L10:; - /* "constraint/problem.py":112 + /* "constraint/problem.py":113 * msg = "Domains must be instances of subclasses of the Domain class" * raise TypeError(msg) * if not domain: # <<<<<<<<<<<<<< * raise ValueError("Domain is empty") * self._variables[variable] = domain */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 112, __pyx_L1_error) - __pyx_t_7 = (!__pyx_t_2); - if (unlikely(__pyx_t_7)) { + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 113, __pyx_L1_error) + __pyx_t_5 = (!__pyx_t_2); + if (unlikely(__pyx_t_5)) { - /* "constraint/problem.py":113 + /* "constraint/problem.py":114 * raise TypeError(msg) * if not domain: * raise ValueError("Domain is empty") # <<<<<<<<<<<<<< * self._variables[variable] = domain * */ - __pyx_t_6 = NULL; - __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_4 = __pyx_builtin_ValueError; - __pyx_t_5 = 1; + __pyx_t_3 = NULL; + __pyx_t_4 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Domain_is_empty}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Domain_is_empty}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 113, __pyx_L1_error) + __PYX_ERR(0, 114, __pyx_L1_error) - /* "constraint/problem.py":112 + /* "constraint/problem.py":113 * msg = "Domains must be instances of subclasses of the Domain class" * raise TypeError(msg) * if not domain: # <<<<<<<<<<<<<< @@ -4482,19 +4451,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU */ } - /* "constraint/problem.py":114 + /* "constraint/problem.py":115 * if not domain: * raise ValueError("Domain is empty") * self._variables[variable] = domain # <<<<<<<<<<<<<< * * def addVariables(self, variables: Sequence, domain): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_variable, __pyx_v_domain) < 0))) __PYX_ERR(0, 114, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_variable, __pyx_v_domain) < 0))) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":86 + /* "constraint/problem.py":85 * return self._solver * * def addVariable(self, variable: Hashable, domain): # <<<<<<<<<<<<<< @@ -4508,8 +4477,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("constraint.problem.Problem.addVariable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -4520,7 +4489,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU return __pyx_r; } -/* "constraint/problem.py":116 +/* "constraint/problem.py":117 * self._variables[variable] = domain * * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< @@ -4570,38 +4539,38 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables_2,&__pyx_mstate_global->__pyx_n_u_domain,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 116, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 117, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 116, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 117, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 116, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 117, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 116, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 117, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addVariables", 0) < 0) __PYX_ERR(0, 116, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addVariables", 0) < (0)) __PYX_ERR(0, 117, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addVariables", 1, 3, 3, i); __PYX_ERR(0, 116, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addVariables", 1, 3, 3, i); __PYX_ERR(0, 117, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 116, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 117, __pyx_L3_error) values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 116, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 117, __pyx_L3_error) values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 116, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 117, __pyx_L3_error) } __pyx_v_self = values[0]; __pyx_v_variables = values[1]; @@ -4609,7 +4578,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("addVariables", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 116, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addVariables", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 117, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4645,7 +4614,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addVariables", 0); - /* "constraint/problem.py":136 + /* "constraint/problem.py":137 * may assume * """ * for variable in variables: # <<<<<<<<<<<<<< @@ -4657,9 +4626,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -4667,17 +4636,17 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 136, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 137, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 136, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 137, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4688,13 +4657,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 136, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 137, __pyx_L1_error) PyErr_Clear(); } break; @@ -4704,26 +4673,26 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/problem.py":137 + /* "constraint/problem.py":138 * """ * for variable in variables: * self.addVariable(variable, domain) # <<<<<<<<<<<<<< * - * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): + * def addConstraint(self, constraint: Constraint | Callable | str, variables: Sequence | None = None): */ __pyx_t_5 = __pyx_v_self; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_variable, __pyx_v_domain}; - __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_addVariable, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_addVariable, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/problem.py":136 + /* "constraint/problem.py":137 * may assume * """ * for variable in variables: # <<<<<<<<<<<<<< @@ -4733,7 +4702,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":116 + /* "constraint/problem.py":117 * self._variables[variable] = domain * * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< @@ -4757,10 +4726,10 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U return __pyx_r; } -/* "constraint/problem.py":139 +/* "constraint/problem.py":140 * self.addVariable(variable, domain) * - * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def addConstraint(self, constraint: Constraint | Callable | str, variables: Sequence | None = None): # <<<<<<<<<<<<<< * """Add a constraint to the problem. * */ @@ -4807,41 +4776,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_constraint,&__pyx_mstate_global->__pyx_n_u_variables_2,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 139, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 140, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 139, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 140, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 139, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 140, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 139, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 140, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addConstraint", 0) < 0) __PYX_ERR(0, 139, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addConstraint", 0) < (0)) __PYX_ERR(0, 140, __pyx_L3_error) if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addConstraint", 0, 2, 3, i); __PYX_ERR(0, 139, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addConstraint", 0, 2, 3, i); __PYX_ERR(0, 140, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 139, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 140, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 139, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 140, __pyx_L3_error) values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 139, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 140, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -4853,7 +4822,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("addConstraint", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 139, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addConstraint", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 140, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4875,7 +4844,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/problem.py":162 +/* "constraint/problem.py":163 * return * elif isinstance(constraint, list): * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" # <<<<<<<<<<<<<< @@ -4895,7 +4864,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_13addConstraint_genexpr if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 162, __pyx_L1_error) + __PYX_ERR(0, 163, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -4903,7 +4872,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_13addConstraint_genexpr __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_13addConstraint_2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_Problem_addConstraint_locals_gen, __pyx_mstate_global->__pyx_n_u_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_13addConstraint_2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_Problem_addConstraint_locals_gen, __pyx_mstate_global->__pyx_n_u_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -4941,16 +4910,16 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 162, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 162, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 163, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 163, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -4958,17 +4927,17 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 162, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 163, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 162, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 163, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -4979,13 +4948,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 162, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 163, __pyx_L1_error) PyErr_Clear(); } break; @@ -5035,10 +5004,10 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera return __pyx_r; } -/* "constraint/problem.py":139 +/* "constraint/problem.py":140 * self.addVariable(variable, domain) * - * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def addConstraint(self, constraint: Constraint | Callable | str, variables: Sequence | None = None): # <<<<<<<<<<<<<< * """Add a constraint to the problem. * */ @@ -5061,7 +5030,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __Pyx_RefNannySetupContext("addConstraint", 0); __Pyx_INCREF(__pyx_v_constraint); - /* "constraint/problem.py":158 + /* "constraint/problem.py":159 * """ # noqa: E501 * # compile string constraints (variables argument ignored as it is inferred from the string and may be reordered) * if isinstance(constraint, str): # <<<<<<<<<<<<<< @@ -5071,19 +5040,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __pyx_t_1 = PyUnicode_Check(__pyx_v_constraint); if (__pyx_t_1) { - /* "constraint/problem.py":159 + /* "constraint/problem.py":160 * # compile string constraints (variables argument ignored as it is inferred from the string and may be reordered) * if isinstance(constraint, str): * self._str_constraints.append(constraint) # <<<<<<<<<<<<<< * return * elif isinstance(constraint, list): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_v_constraint); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_v_constraint); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":160 + /* "constraint/problem.py":161 * if isinstance(constraint, str): * self._str_constraints.append(constraint) * return # <<<<<<<<<<<<<< @@ -5094,7 +5063,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/problem.py":158 + /* "constraint/problem.py":159 * """ # noqa: E501 * # compile string constraints (variables argument ignored as it is inferred from the string and may be reordered) * if isinstance(constraint, str): # <<<<<<<<<<<<<< @@ -5103,7 +5072,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ */ } - /* "constraint/problem.py":161 + /* "constraint/problem.py":162 * self._str_constraints.append(constraint) * return * elif isinstance(constraint, list): # <<<<<<<<<<<<<< @@ -5113,7 +5082,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __pyx_t_1 = PyList_Check(__pyx_v_constraint); if (__pyx_t_1) { - /* "constraint/problem.py":162 + /* "constraint/problem.py":163 * return * elif isinstance(constraint, list): * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" # <<<<<<<<<<<<<< @@ -5122,51 +5091,51 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_2 = __pyx_pf_10constraint_7problem_7Problem_13addConstraint_genexpr(NULL, __pyx_v_constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_7problem_7Problem_13addConstraint_genexpr(NULL, __pyx_v_constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) { - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_constraint, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_constraint, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Expected_constraints_to_be_strin, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Expected_constraints_to_be_strin, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0); + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 162, __pyx_L1_error) + __PYX_ERR(0, 163, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 162, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 163, __pyx_L1_error) #endif - /* "constraint/problem.py":163 + /* "constraint/problem.py":164 * elif isinstance(constraint, list): * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" * self._str_constraints.extend(constraint) # <<<<<<<<<<<<<< * return * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_constraint}; - __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_extend, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_extend, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":164 + /* "constraint/problem.py":165 * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" * self._str_constraints.extend(constraint) * return # <<<<<<<<<<<<<< @@ -5177,7 +5146,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/problem.py":161 + /* "constraint/problem.py":162 * self._str_constraints.append(constraint) * return * elif isinstance(constraint, list): # <<<<<<<<<<<<<< @@ -5186,31 +5155,31 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ */ } - /* "constraint/problem.py":167 + /* "constraint/problem.py":168 * * # add regular constraints * if not isinstance(constraint, Constraint): # <<<<<<<<<<<<<< * if callable(constraint): * # future warn("A function or lambda has been used for a constraint, consider using string constraints") */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_IsInstance(__pyx_v_constraint, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_1 = PyObject_IsInstance(__pyx_v_constraint, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = (!__pyx_t_1); if (__pyx_t_7) { - /* "constraint/problem.py":168 + /* "constraint/problem.py":169 * # add regular constraints * if not isinstance(constraint, Constraint): * if callable(constraint): # <<<<<<<<<<<<<< * # future warn("A function or lambda has been used for a constraint, consider using string constraints") * constraint = FunctionConstraint(constraint) */ - __pyx_t_7 = __Pyx_PyCallable_Check(__pyx_v_constraint); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyCallable_Check(__pyx_v_constraint); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 169, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/problem.py":170 + /* "constraint/problem.py":171 * if callable(constraint): * # future warn("A function or lambda has been used for a constraint, consider using string constraints") * constraint = FunctionConstraint(constraint) # <<<<<<<<<<<<<< @@ -5218,7 +5187,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * constraint = CompilableFunctionConstraint(constraint) */ __pyx_t_5 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -5234,16 +5203,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_constraint}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_constraint, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":168 + /* "constraint/problem.py":169 * # add regular constraints * if not isinstance(constraint, Constraint): * if callable(constraint): # <<<<<<<<<<<<<< @@ -5253,7 +5222,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ goto __pyx_L5; } - /* "constraint/problem.py":171 + /* "constraint/problem.py":172 * # future warn("A function or lambda has been used for a constraint, consider using string constraints") * constraint = FunctionConstraint(constraint) * elif isinstance(constraint, str): # <<<<<<<<<<<<<< @@ -5263,7 +5232,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __pyx_t_7 = PyUnicode_Check(__pyx_v_constraint); if (likely(__pyx_t_7)) { - /* "constraint/problem.py":172 + /* "constraint/problem.py":173 * constraint = FunctionConstraint(constraint) * elif isinstance(constraint, str): * constraint = CompilableFunctionConstraint(constraint) # <<<<<<<<<<<<<< @@ -5271,7 +5240,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * msg = "Constraints must be instances of subclasses " "of the Constraint class" */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -5287,16 +5256,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_constraint}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF_SET(__pyx_v_constraint, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":171 + /* "constraint/problem.py":172 * # future warn("A function or lambda has been used for a constraint, consider using string constraints") * constraint = FunctionConstraint(constraint) * elif isinstance(constraint, str): # <<<<<<<<<<<<<< @@ -5306,7 +5275,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ goto __pyx_L5; } - /* "constraint/problem.py":174 + /* "constraint/problem.py":175 * constraint = CompilableFunctionConstraint(constraint) * else: * msg = "Constraints must be instances of subclasses " "of the Constraint class" # <<<<<<<<<<<<<< @@ -5317,7 +5286,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Constraints_must_be_instances_of); __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_Constraints_must_be_instances_of; - /* "constraint/problem.py":175 + /* "constraint/problem.py":176 * else: * msg = "Constraints must be instances of subclasses " "of the Constraint class" * raise ValueError(msg) # <<<<<<<<<<<<<< @@ -5325,24 +5294,21 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ * */ __pyx_t_5 = NULL; - __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_4 = __pyx_builtin_ValueError; __pyx_t_6 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_msg}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 175, __pyx_L1_error) + __PYX_ERR(0, 176, __pyx_L1_error) } __pyx_L5:; - /* "constraint/problem.py":167 + /* "constraint/problem.py":168 * * # add regular constraints * if not isinstance(constraint, Constraint): # <<<<<<<<<<<<<< @@ -5351,31 +5317,31 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ */ } - /* "constraint/problem.py":176 + /* "constraint/problem.py":177 * msg = "Constraints must be instances of subclasses " "of the Constraint class" * raise ValueError(msg) * self._constraints.append((constraint, variables)) # <<<<<<<<<<<<<< * * def getSolution(self): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_constraint); __Pyx_GIVEREF(__pyx_v_constraint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 176, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 177, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 176, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 176, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 177, __pyx_L1_error); + __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_5); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/problem.py":139 + /* "constraint/problem.py":140 * self.addVariable(variable, domain) * - * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def addConstraint(self, constraint: Constraint | Callable | str, variables: Sequence | None = None): # <<<<<<<<<<<<<< * """Add a constraint to the problem. * */ @@ -5398,7 +5364,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ return __pyx_r; } -/* "constraint/problem.py":178 +/* "constraint/problem.py":179 * self._constraints.append((constraint, variables)) * * def getSolution(self): # <<<<<<<<<<<<<< @@ -5446,32 +5412,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 178, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 179, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 178, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 179, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < 0) __PYX_ERR(0, 178, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < (0)) __PYX_ERR(0, 179, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 1, 1, i); __PYX_ERR(0, 178, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 1, 1, i); __PYX_ERR(0, 179, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 178, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 179, __pyx_L3_error) } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 178, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getSolution", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 179, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5512,7 +5478,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolution", 0); - /* "constraint/problem.py":192 + /* "constraint/problem.py":193 * dictionary mapping variables to values: Solution for the problem * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< @@ -5521,22 +5487,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN */ __pyx_t_2 = __pyx_v_self; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL}; - __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_picklable, __pyx_t_4, __pyx_t_3, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 192, __pyx_L1_error) - __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_getArgs, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_picklable, __pyx_t_4, __pyx_t_3, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_getArgs, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -5545,7 +5511,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 192, __pyx_L1_error) + __PYX_ERR(0, 193, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -5556,28 +5522,28 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 2); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); @@ -5587,7 +5553,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 192, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; @@ -5595,7 +5561,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 192, __pyx_L1_error) + __PYX_ERR(0, 193, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_domains = __pyx_t_3; @@ -5605,18 +5571,18 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN __pyx_v_vconstraints = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/problem.py":193 + /* "constraint/problem.py":194 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< * return None * return self._solver.getSolution(domains, constraints, vconstraints) */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_8); if (__pyx_t_9) { - /* "constraint/problem.py":194 + /* "constraint/problem.py":195 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: * return None # <<<<<<<<<<<<<< @@ -5627,7 +5593,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/problem.py":193 + /* "constraint/problem.py":194 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< @@ -5636,7 +5602,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN */ } - /* "constraint/problem.py":195 + /* "constraint/problem.py":196 * if not domains: * return None * return self._solver.getSolution(domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -5644,24 +5610,24 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN * def getSolutions(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_getSolution, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolution, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":178 + /* "constraint/problem.py":179 * self._constraints.append((constraint, variables)) * * def getSolution(self): # <<<<<<<<<<<<<< @@ -5687,7 +5653,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN return __pyx_r; } -/* "constraint/problem.py":197 +/* "constraint/problem.py":198 * return self._solver.getSolution(domains, constraints, vconstraints) * * def getSolutions(self): # <<<<<<<<<<<<<< @@ -5735,32 +5701,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 197, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 198, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 197, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 198, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutions", 0) < 0) __PYX_ERR(0, 197, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutions", 0) < (0)) __PYX_ERR(0, 198, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 1, 1, i); __PYX_ERR(0, 197, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 1, 1, i); __PYX_ERR(0, 198, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 197, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 198, __pyx_L3_error) } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 197, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 198, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5801,7 +5767,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutions", 0); - /* "constraint/problem.py":211 + /* "constraint/problem.py":212 * list of dictionaries mapping variables to values: All solutions for the problem * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< @@ -5810,22 +5776,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U */ __pyx_t_2 = __pyx_v_self; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL}; - __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_picklable, __pyx_t_4, __pyx_t_3, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 211, __pyx_L1_error) - __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_getArgs, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_picklable, __pyx_t_4, __pyx_t_3, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_getArgs, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -5834,7 +5800,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 211, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -5845,28 +5811,28 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 2); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); @@ -5876,7 +5842,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 211, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < (0)) __PYX_ERR(0, 212, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; @@ -5884,7 +5850,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 211, __pyx_L1_error) + __PYX_ERR(0, 212, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_domains = __pyx_t_3; @@ -5894,18 +5860,18 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U __pyx_v_vconstraints = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/problem.py":212 + /* "constraint/problem.py":213 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< * return [] * return self._solver.getSolutions(domains, constraints, vconstraints) */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 213, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_8); if (__pyx_t_9) { - /* "constraint/problem.py":213 + /* "constraint/problem.py":214 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: * return [] # <<<<<<<<<<<<<< @@ -5913,13 +5879,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":212 + /* "constraint/problem.py":213 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< @@ -5928,7 +5894,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U */ } - /* "constraint/problem.py":214 + /* "constraint/problem.py":215 * if not domains: * return [] * return self._solver.getSolutions(domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -5936,24 +5902,24 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U * def getSolutionIter(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":197 + /* "constraint/problem.py":198 * return self._solver.getSolution(domains, constraints, vconstraints) * * def getSolutions(self): # <<<<<<<<<<<<<< @@ -5979,7 +5945,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U return __pyx_r; } -/* "constraint/problem.py":216 +/* "constraint/problem.py":217 * return self._solver.getSolutions(domains, constraints, vconstraints) * * def getSolutionIter(self): # <<<<<<<<<<<<<< @@ -6027,32 +5993,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 216, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 217, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 216, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 217, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionIter", 0) < 0) __PYX_ERR(0, 216, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionIter", 0) < (0)) __PYX_ERR(0, 217, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 1, 1, i); __PYX_ERR(0, 216, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 1, 1, i); __PYX_ERR(0, 217, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 216, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 217, __pyx_L3_error) } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 216, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 217, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6093,7 +6059,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionIter", 0); - /* "constraint/problem.py":232 + /* "constraint/problem.py":233 * StopIteration * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< @@ -6102,22 +6068,22 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO */ __pyx_t_2 = __pyx_v_self; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL}; - __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_picklable, __pyx_t_4, __pyx_t_3, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 232, __pyx_L1_error) - __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_getArgs, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_picklable, __pyx_t_4, __pyx_t_3, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_getArgs, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -6126,7 +6092,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 233, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -6137,28 +6103,28 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 2); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } #else - __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); @@ -6168,7 +6134,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < (0)) __PYX_ERR(0, 233, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; @@ -6176,7 +6142,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 233, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_domains = __pyx_t_3; @@ -6186,18 +6152,18 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO __pyx_v_vconstraints = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/problem.py":233 + /* "constraint/problem.py":234 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< * return iter(()) * return self._solver.getSolutionIter(domains, constraints, vconstraints) */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 234, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_8); if (__pyx_t_9) { - /* "constraint/problem.py":234 + /* "constraint/problem.py":235 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: * return iter(()) # <<<<<<<<<<<<<< @@ -6205,13 +6171,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetIter(__pyx_mstate_global->__pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = PyObject_GetIter(__pyx_mstate_global->__pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":233 + /* "constraint/problem.py":234 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< @@ -6220,7 +6186,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO */ } - /* "constraint/problem.py":235 + /* "constraint/problem.py":236 * if not domains: * return iter(()) * return self._solver.getSolutionIter(domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -6228,24 +6194,24 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":216 + /* "constraint/problem.py":217 * return self._solver.getSolutions(domains, constraints, vconstraints) * * def getSolutionIter(self): # <<<<<<<<<<<<<< @@ -6271,7 +6237,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO return __pyx_r; } -/* "constraint/problem.py":237 +/* "constraint/problem.py":238 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< @@ -6320,35 +6286,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_order,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 237, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 238, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 237, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 238, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 237, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 238, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionsOrderedList", 0) < 0) __PYX_ERR(0, 237, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionsOrderedList", 0) < (0)) __PYX_ERR(0, 238, __pyx_L3_error) if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutionsOrderedList", 0, 1, 2, i); __PYX_ERR(0, 237, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutionsOrderedList", 0, 1, 2, i); __PYX_ERR(0, 238, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 237, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 238, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 237, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 238, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -6359,7 +6325,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getSolutionsOrderedList", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 237, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getSolutionsOrderedList", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 238, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6370,7 +6336,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyList_Type), 1, "order", 2))) __PYX_ERR(0, 237, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyList_Type), 1, "order", 2))) __PYX_ERR(0, 238, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedList(__pyx_self, __pyx_v_self, __pyx_v_order); /* function exit code */ @@ -6391,7 +6357,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedList_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/problem.py":241 +/* "constraint/problem.py":242 * solutions: list[dict] = self.getSolutions() * if order is None or len(order) == 1: * return list(tuple(solution.values()) for solution in solutions) # <<<<<<<<<<<<<< @@ -6411,7 +6377,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedLi if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 241, __pyx_L1_error) + __PYX_ERR(0, 242, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6419,7 +6385,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedLi __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedList_2generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionsOrderedList, __pyx_mstate_global->__pyx_n_u_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedList_2generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionsOrderedList, __pyx_mstate_global->__pyx_n_u_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6456,13 +6422,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 241, __pyx_L1_error) - __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 241, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 241, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 242, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_genexpr_arg_0 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 241, __pyx_L1_error) + __PYX_ERR(0, 242, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -6470,13 +6436,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 241, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 242, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_solution); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_solution, __pyx_t_3); @@ -6487,15 +6453,15 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi __pyx_t_5 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_values, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_values, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 241, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6524,7 +6490,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi } static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedList_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/problem.py":243 +/* "constraint/problem.py":244 * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) * return list(get_in_order(params) for params in solutions) # <<<<<<<<<<<<<< @@ -6544,7 +6510,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedLi if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 243, __pyx_L1_error) + __PYX_ERR(0, 244, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6555,7 +6521,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedLi __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedList_5generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionsOrderedList, __pyx_mstate_global->__pyx_n_u_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedList_5generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionsOrderedList, __pyx_mstate_global->__pyx_n_u_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6593,13 +6559,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 243, __pyx_L1_error) - __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 243, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 243, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 244, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_genexpr_arg_0 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 243, __pyx_L1_error) + __PYX_ERR(0, 244, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -6607,20 +6573,20 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 243, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 244, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_params); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_params, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_get_in_order)) { __Pyx_RaiseClosureNameError("get_in_order"); __PYX_ERR(0, 243, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_get_in_order)) { __Pyx_RaiseClosureNameError("get_in_order"); __PYX_ERR(0, 244, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_get_in_order); __pyx_t_5 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_get_in_order; __pyx_t_6 = 1; @@ -6637,13 +6603,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_params}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } - if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 243, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6672,7 +6638,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi return __pyx_r; } -/* "constraint/problem.py":237 +/* "constraint/problem.py":238 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< @@ -6702,12 +6668,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 237, __pyx_L1_error) + __PYX_ERR(0, 238, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/problem.py":239 + /* "constraint/problem.py":240 * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: * """Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`.""" * solutions: list[dict] = self.getSolutions() # <<<<<<<<<<<<<< @@ -6719,16 +6685,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 239, __pyx_L1_error) + if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 240, __pyx_L1_error) __pyx_v_solutions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":240 + /* "constraint/problem.py":241 * """Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`.""" * solutions: list[dict] = self.getSolutions() * if order is None or len(order) == 1: # <<<<<<<<<<<<<< @@ -6743,15 +6709,15 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi } if (unlikely(__pyx_v_order == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 240, __pyx_L1_error) + __PYX_ERR(0, 241, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_order); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_v_order); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 241, __pyx_L1_error) __pyx_t_5 = (__pyx_t_6 == 1); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { - /* "constraint/problem.py":241 + /* "constraint/problem.py":242 * solutions: list[dict] = self.getSolutions() * if order is None or len(order) == 1: * return list(tuple(solution.values()) for solution in solutions) # <<<<<<<<<<<<<< @@ -6759,16 +6725,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi * return list(get_in_order(params) for params in solutions) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_genexpr(NULL, __pyx_v_solutions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_genexpr(NULL, __pyx_v_solutions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/problem.py":240 + /* "constraint/problem.py":241 * """Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`.""" * solutions: list[dict] = self.getSolutions() * if order is None or len(order) == 1: # <<<<<<<<<<<<<< @@ -6777,18 +6743,18 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi */ } - /* "constraint/problem.py":242 + /* "constraint/problem.py":243 * if order is None or len(order) == 1: * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) # <<<<<<<<<<<<<< * return list(get_in_order(params) for params in solutions) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_itemgetter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_itemgetter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PySequence_Tuple(__pyx_v_order); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_1 = PySequence_Tuple(__pyx_v_order); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6796,7 +6762,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi __pyx_cur_scope->__pyx_v_get_in_order = __pyx_t_7; __pyx_t_7 = 0; - /* "constraint/problem.py":243 + /* "constraint/problem.py":244 * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) * return list(get_in_order(params) for params in solutions) # <<<<<<<<<<<<<< @@ -6804,16 +6770,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi * def getSolutionsAsListDict( */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_3genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_solutions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_7 = __pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_3genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_solutions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":237 + /* "constraint/problem.py":238 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< @@ -6838,7 +6804,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi return __pyx_r; } -/* "constraint/problem.py":245 +/* "constraint/problem.py":246 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< @@ -6865,7 +6831,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_order = 0; - PyObject *__pyx_v_validate = 0; + int __pyx_v_validate; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -6888,28 +6854,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_order,&__pyx_mstate_global->__pyx_n_u_validate,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 245, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 246, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 245, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 246, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 245, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 246, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 245, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 246, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionsAsListDict", 0) < 0) __PYX_ERR(0, 245, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionsAsListDict", 0) < (0)) __PYX_ERR(0, 246, __pyx_L3_error) - /* "constraint/problem.py":246 + /* "constraint/problem.py":247 * * def getSolutionsAsListDict( * self, order: list[str] = None, validate: bool = True # <<<<<<<<<<<<<< @@ -6917,36 +6883,38 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * """Returns the searchspace as a list of tuples, a dict of the searchspace for fast lookups and the size.""" */ if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutionsAsListDict", 0, 1, 3, i); __PYX_ERR(0, 245, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutionsAsListDict", 0, 1, 3, i); __PYX_ERR(0, 246, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 245, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 246, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 245, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 246, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 245, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 246, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)Py_None)); - if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); } __pyx_v_self = values[0]; __pyx_v_order = ((PyObject*)values[1]); - __pyx_v_validate = values[2]; + if (values[2]) { + __pyx_v_validate = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_validate == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L3_error) + } else { + __pyx_v_validate = ((int)((int)1)); + } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getSolutionsAsListDict", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 245, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getSolutionsAsListDict", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 246, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6957,10 +6925,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyList_Type), 1, "order", 2))) __PYX_ERR(0, 246, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyList_Type), 1, "order", 2))) __PYX_ERR(0, 247, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDict(__pyx_self, __pyx_v_self, __pyx_v_order, __pyx_v_validate); - /* "constraint/problem.py":245 + /* "constraint/problem.py":246 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< @@ -6985,11 +6953,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_order, PyObject *__pyx_v_validate) { +static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_order, int __pyx_v_validate) { PyObject *__pyx_v_solutions_list = NULL; PyObject *__pyx_v_size_list = NULL; PyObject *__pyx_v_solutions_dict = 0; PyObject *__pyx_v_size_dict = NULL; + PyObject *__pyx_8genexpr3__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -7000,16 +6969,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - int __pyx_t_12; + int __pyx_t_9; + PyObject *__pyx_t_10[4]; + PyObject *(*__pyx_t_11)(PyObject *); + PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionsAsListDict", 0); - /* "constraint/problem.py":249 + /* "constraint/problem.py":250 * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 * """Returns the searchspace as a list of tuples, a dict of the searchspace for fast lookups and the size.""" * solutions_list = self.getSolutionsOrderedList(order) # <<<<<<<<<<<<<< @@ -7021,28 +6990,28 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_order}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_getSolutionsOrderedList, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolutionsOrderedList, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_solutions_list = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/problem.py":250 + /* "constraint/problem.py":251 * """Returns the searchspace as a list of tuples, a dict of the searchspace for fast lookups and the size.""" * solutions_list = self.getSolutionsOrderedList(order) * size_list = len(solutions_list) # <<<<<<<<<<<<<< * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) * if validate: */ - __pyx_t_4 = PyObject_Length(__pyx_v_solutions_list); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 250, __pyx_L1_error) - __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_v_solutions_list); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_size_list = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/problem.py":251 + /* "constraint/problem.py":252 * solutions_list = self.getSolutionsOrderedList(order) * size_list = len(solutions_list) * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) # <<<<<<<<<<<<<< @@ -7050,131 +7019,255 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic * # check for duplicates */ __pyx_t_2 = NULL; - __Pyx_INCREF((PyObject *)(&PyDict_Type)); - __pyx_t_5 = ((PyObject *)(&PyDict_Type)); - __pyx_t_7 = NULL; - __Pyx_INCREF(__pyx_builtin_zip); - __pyx_t_8 = __pyx_builtin_zip; - __pyx_t_10 = NULL; - __Pyx_INCREF(__pyx_builtin_range); - __pyx_t_11 = __pyx_builtin_range; + __pyx_t_6 = NULL; + __pyx_t_8 = NULL; __pyx_t_3 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_size_list}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_size_list}; + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); } __pyx_t_3 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_solutions_list, __pyx_t_9}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_solutions_list, __pyx_t_7}; + __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); } __pyx_t_3 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyDict_Type), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_solutions_dict = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":252 + /* "constraint/problem.py":253 * size_list = len(solutions_list) * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) * if validate: # <<<<<<<<<<<<<< * # check for duplicates * size_dict = len(solutions_dict) */ - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_validate); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) - if (__pyx_t_12) { + if (__pyx_v_validate) { - /* "constraint/problem.py":254 + /* "constraint/problem.py":255 * if validate: * # check for duplicates * size_dict = len(solutions_dict) # <<<<<<<<<<<<<< * if size_list != size_dict: * raise ValueError( */ - __pyx_t_4 = PyDict_Size(__pyx_v_solutions_dict); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 254, __pyx_L1_error) - __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_4 = PyDict_Size(__pyx_v_solutions_dict); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_size_dict = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/problem.py":255 + /* "constraint/problem.py":256 * # check for duplicates * size_dict = len(solutions_dict) * if size_list != size_dict: # <<<<<<<<<<<<<< * raise ValueError( - * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." + * f"{size_list - size_dict} duplicate parameter configurations out of {size_dict} unique.", */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_size_list, __pyx_v_size_dict, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_size_list, __pyx_v_size_dict, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__pyx_t_12)) { + if (unlikely(__pyx_t_9)) { - /* "constraint/problem.py":256 + /* "constraint/problem.py":257 * size_dict = len(solutions_dict) * if size_list != size_dict: * raise ValueError( # <<<<<<<<<<<<<< - * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." - * ) + * f"{size_list - size_dict} duplicate parameter configurations out of {size_dict} unique.", + * f"Duplicate configs: {list(set([c for c in solutions_list if solutions_list.count(c) > 1]))}", */ __pyx_t_5 = NULL; - __Pyx_INCREF(__pyx_builtin_ValueError); - __pyx_t_6 = __pyx_builtin_ValueError; - /* "constraint/problem.py":257 + /* "constraint/problem.py":258 * if size_list != size_dict: * raise ValueError( - * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." # <<<<<<<<<<<<<< + * f"{size_list - size_dict} duplicate parameter configurations out of {size_dict} unique.", # <<<<<<<<<<<<<< + * f"Duplicate configs: {list(set([c for c in solutions_list if solutions_list.count(c) > 1]))}", + * f"Constraints: {self._constraints}, {self._str_constraints}" +*/ + __pyx_t_2 = PyNumber_Subtract(__pyx_v_size_list, __pyx_v_size_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_size_dict, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10[0] = __pyx_t_7; + __pyx_t_10[1] = __pyx_mstate_global->__pyx_kp_u_duplicate_parameter_configurati; + __pyx_t_10[2] = __pyx_t_2; + __pyx_t_10[3] = __pyx_mstate_global->__pyx_kp_u_unique; + __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 43 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/problem.py":259 + * raise ValueError( + * f"{size_list - size_dict} duplicate parameter configurations out of {size_dict} unique.", + * f"Duplicate configs: {list(set([c for c in solutions_list if solutions_list.count(c) > 1]))}", # <<<<<<<<<<<<<< + * f"Constraints: {self._constraints}, {self._str_constraints}" * ) - * return ( */ - __pyx_t_2 = PyNumber_Subtract(__pyx_v_size_list, __pyx_v_size_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_v_solutions_list)) || PyTuple_CheckExact(__pyx_v_solutions_list)) { + __pyx_t_7 = __pyx_v_solutions_list; __Pyx_INCREF(__pyx_t_7); + __pyx_t_4 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_solutions_list); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 259, __pyx_L7_error) + } + for (;;) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 259, __pyx_L7_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_4; + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 259, __pyx_L7_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_4)); + #else + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); + #endif + ++__pyx_t_4; + } + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L7_error) + } else { + __pyx_t_8 = __pyx_t_11(__pyx_t_7); + if (unlikely(!__pyx_t_8)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 259, __pyx_L7_error) + PyErr_Clear(); + } + break; + } + } + __Pyx_GOTREF(__pyx_t_8); + __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_c, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_12 = __pyx_v_solutions_list; + __Pyx_INCREF(__pyx_t_12); + __pyx_t_3 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_8genexpr3__pyx_v_c}; + __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_count, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L7_error) + __Pyx_GOTREF(__pyx_t_8); + } + __pyx_t_12 = PyObject_RichCompare(__pyx_t_8, __pyx_mstate_global->__pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 259, __pyx_L7_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 259, __pyx_L7_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__pyx_t_9) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_8genexpr3__pyx_v_c))) __PYX_ERR(0, 259, __pyx_L7_error) + } + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_c); __pyx_8genexpr3__pyx_v_c = 0; + goto __pyx_L12_exit_scope; + __pyx_L7_error:; + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_c); __pyx_8genexpr3__pyx_v_c = 0; + goto __pyx_L1_error; + __pyx_L12_exit_scope:; + } /* exit inner scope */ + __pyx_t_7 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_duplicate_parameter_configurati); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Duplicate_configs, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "constraint/problem.py":260 + * f"{size_list - size_dict} duplicate parameter configurations out of {size_dict} unique.", + * f"Duplicate configs: {list(set([c for c in solutions_list if solutions_list.count(c) > 1]))}", + * f"Constraints: {self._constraints}, {self._str_constraints}" # <<<<<<<<<<<<<< + * ) + * return ( +*/ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Constraints; + __pyx_t_10[1] = __pyx_t_12; + __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u__2; + __pyx_t_10[3] = __pyx_t_8; + __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8)); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_t_6, __pyx_t_2, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 256, __pyx_L1_error) + __PYX_ERR(0, 257, __pyx_L1_error) - /* "constraint/problem.py":255 + /* "constraint/problem.py":256 * # check for duplicates * size_dict = len(solutions_dict) * if size_list != size_dict: # <<<<<<<<<<<<<< * raise ValueError( - * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." + * f"{size_list - size_dict} duplicate parameter configurations out of {size_dict} unique.", */ } - /* "constraint/problem.py":252 + /* "constraint/problem.py":253 * size_list = len(solutions_list) * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) * if validate: # <<<<<<<<<<<<<< @@ -7183,8 +7276,8 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic */ } - /* "constraint/problem.py":259 - * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." + /* "constraint/problem.py":262 + * f"Constraints: {self._constraints}, {self._str_constraints}" * ) * return ( # <<<<<<<<<<<<<< * solutions_list, @@ -7192,29 +7285,29 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic */ __Pyx_XDECREF(__pyx_r); - /* "constraint/problem.py":260 + /* "constraint/problem.py":263 * ) * return ( * solutions_list, # <<<<<<<<<<<<<< * solutions_dict, * size_list, */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_solutions_list); __Pyx_GIVEREF(__pyx_v_solutions_list); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_solutions_list) != (0)) __PYX_ERR(0, 260, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_solutions_list) != (0)) __PYX_ERR(0, 263, __pyx_L1_error); __Pyx_INCREF(__pyx_v_solutions_dict); __Pyx_GIVEREF(__pyx_v_solutions_dict); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_solutions_dict) != (0)) __PYX_ERR(0, 260, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_solutions_dict) != (0)) __PYX_ERR(0, 263, __pyx_L1_error); __Pyx_INCREF(__pyx_v_size_list); __Pyx_GIVEREF(__pyx_v_size_list); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_size_list) != (0)) __PYX_ERR(0, 260, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_size_list) != (0)) __PYX_ERR(0, 263, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":245 + /* "constraint/problem.py":246 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< @@ -7230,9 +7323,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("constraint.problem.Problem.getSolutionsAsListDict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -7240,12 +7331,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic __Pyx_XDECREF(__pyx_v_size_list); __Pyx_XDECREF(__pyx_v_solutions_dict); __Pyx_XDECREF(__pyx_v_size_dict); + __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "constraint/problem.py":265 +/* "constraint/problem.py":268 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< @@ -7293,35 +7385,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_picklable,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 265, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 268, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 265, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 268, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 265, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 268, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_getArgs", 0) < 0) __PYX_ERR(0, 265, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_getArgs", 0) < (0)) __PYX_ERR(0, 268, __pyx_L3_error) if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_getArgs", 0, 1, 2, i); __PYX_ERR(0, 265, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_getArgs", 0, 1, 2, i); __PYX_ERR(0, 268, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 2: values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 265, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 268, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 265, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 268, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -7332,7 +7424,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_getArgs", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 265, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_getArgs", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 268, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7354,7 +7446,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/problem.py":286 +/* "constraint/problem.py":289 * # check if there are any precompiled FunctionConstraints when there shouldn't be * if picklable: * assert not any(isinstance(c, FunctionConstraint) for c, _ in constraints), f"You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why)" # noqa E501 # <<<<<<<<<<<<<< @@ -7374,7 +7466,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8_getArgs_genexpr(CYTHO if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 286, __pyx_L1_error) + __PYX_ERR(0, 289, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -7382,7 +7474,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8_getArgs_genexpr(CYTHO __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_Problem__getArgs_locals_genexpr, __pyx_mstate_global->__pyx_n_u_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_Problem__getArgs_locals_genexpr, __pyx_mstate_global->__pyx_n_u_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -7422,21 +7514,21 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 286, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 286, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 289, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 289, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 286, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 289, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; @@ -7444,7 +7536,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 286, __pyx_L1_error) + __PYX_ERR(0, 289, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7453,23 +7545,23 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_5); } #else - __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); @@ -7477,7 +7569,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 286, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < (0)) __PYX_ERR(0, 289, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; @@ -7485,7 +7577,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 286, __pyx_L1_error) + __PYX_ERR(0, 289, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); @@ -7496,9 +7588,9 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_c, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_8 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_c, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { __Pyx_XDECREF(__pyx_r); @@ -7540,7 +7632,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ return __pyx_r; } -/* "constraint/problem.py":265 +/* "constraint/problem.py":268 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< @@ -7587,30 +7679,30 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_getArgs", 0); - /* "constraint/problem.py":266 + /* "constraint/problem.py":269 * * def _getArgs(self, picklable=False): * domains = self._variables.copy() # <<<<<<<<<<<<<< * allvariables = domains.keys() * constraints: list[tuple[Constraint, list]] = [] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_domains = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/problem.py":267 + /* "constraint/problem.py":270 * def _getArgs(self, picklable=False): * domains = self._variables.copy() * allvariables = domains.keys() # <<<<<<<<<<<<<< @@ -7622,57 +7714,57 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_keys, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_keys, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_allvariables = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/problem.py":268 + /* "constraint/problem.py":271 * domains = self._variables.copy() * allvariables = domains.keys() * constraints: list[tuple[Constraint, list]] = [] # <<<<<<<<<<<<<< * * # parse string constraints */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_constraints = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":271 + /* "constraint/problem.py":274 * * # parse string constraints * if len(self._str_constraints) > 0: # <<<<<<<<<<<<<< * # warn("String constraints are a beta feature, please report issues experienced.") # future: remove * for constraint in self._str_constraints: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (__pyx_t_5 > 0); if (__pyx_t_6) { - /* "constraint/problem.py":273 + /* "constraint/problem.py":276 * if len(self._str_constraints) > 0: * # warn("String constraints are a beta feature, please report issues experienced.") # future: remove * for constraint in self._str_constraints: # <<<<<<<<<<<<<< * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 276, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -7681,17 +7773,17 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 273, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 276, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 273, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 276, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -7702,13 +7794,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 273, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 276, __pyx_L1_error) PyErr_Clear(); } break; @@ -7718,7 +7810,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":274 + /* "constraint/problem.py":277 * # warn("String constraints are a beta feature, please report issues experienced.") # future: remove * for constraint in self._str_constraints: * parsed = compile_to_constraints([constraint], domains, picklable=picklable) # <<<<<<<<<<<<<< @@ -7726,13 +7818,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE * self.addConstraint(c, v) */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_compile_to_constraints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_compile_to_constraints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_constraint); __Pyx_GIVEREF(__pyx_v_constraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 274, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 277, __pyx_L1_error); __pyx_t_4 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { @@ -7747,21 +7839,21 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif { PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_9, __pyx_v_domains}; - __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_picklable, __pyx_v_picklable, __pyx_t_10, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 274, __pyx_L1_error) - __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_picklable, __pyx_v_picklable, __pyx_t_10, __pyx_callargs+3, 0) < (0)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_parsed, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":275 + /* "constraint/problem.py":278 * for constraint in self._str_constraints: * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: # <<<<<<<<<<<<<< @@ -7773,9 +7865,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parsed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parsed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 278, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { @@ -7783,17 +7875,17 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 275, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 278, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_11); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 275, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 278, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -7804,13 +7896,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error) } else { __pyx_t_8 = __pyx_t_12(__pyx_t_1); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 275, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 278, __pyx_L1_error) PyErr_Clear(); } break; @@ -7823,7 +7915,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 275, __pyx_L1_error) + __PYX_ERR(0, 278, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7834,28 +7926,28 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 2); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 2, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } #else - __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); @@ -7865,7 +7957,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_GOTREF(__pyx_t_9); index = 2; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < 0) __PYX_ERR(0, 275, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < (0)) __PYX_ERR(0, 278, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L9_unpacking_done; @@ -7873,7 +7965,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 275, __pyx_L1_error) + __PYX_ERR(0, 278, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_10); @@ -7883,7 +7975,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":276 + /* "constraint/problem.py":279 * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: * self.addConstraint(c, v) # <<<<<<<<<<<<<< @@ -7895,14 +7987,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __pyx_t_4 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_c, __pyx_v_v}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_addConstraint, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_addConstraint, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":275 + /* "constraint/problem.py":278 * for constraint in self._str_constraints: * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: # <<<<<<<<<<<<<< @@ -7912,7 +8004,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":273 + /* "constraint/problem.py":276 * if len(self._str_constraints) > 0: * # warn("String constraints are a beta feature, please report issues experienced.") # future: remove * for constraint in self._str_constraints: # <<<<<<<<<<<<<< @@ -7922,7 +8014,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":271 + /* "constraint/problem.py":274 * * # parse string constraints * if len(self._str_constraints) > 0: # <<<<<<<<<<<<<< @@ -7931,23 +8023,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE */ } - /* "constraint/problem.py":279 + /* "constraint/problem.py":282 * * # add regular constraints * for constraint, variables in self._constraints: # <<<<<<<<<<<<<< * if not variables: * variables = list(allvariables) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -7956,17 +8048,17 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 279, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 282, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 279, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 282, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -7977,13 +8069,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) } else { __pyx_t_3 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 279, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 282, __pyx_L1_error) PyErr_Clear(); } break; @@ -7996,7 +8088,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 279, __pyx_L1_error) + __PYX_ERR(0, 282, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8005,23 +8097,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } #else - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -8029,7 +8121,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < 0) __PYX_ERR(0, 279, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 282, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L15_unpacking_done; @@ -8037,7 +8129,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 279, __pyx_L1_error) + __PYX_ERR(0, 282, __pyx_L1_error) __pyx_L15_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_8); @@ -8045,30 +8137,30 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":280 + /* "constraint/problem.py":283 * # add regular constraints * for constraint, variables in self._constraints: * if not variables: # <<<<<<<<<<<<<< * variables = list(allvariables) * constraints.append((constraint, variables)) */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 283, __pyx_L1_error) __pyx_t_15 = (!__pyx_t_6); if (__pyx_t_15) { - /* "constraint/problem.py":281 + /* "constraint/problem.py":284 * for constraint, variables in self._constraints: * if not variables: * variables = list(allvariables) # <<<<<<<<<<<<<< * constraints.append((constraint, variables)) * */ - __pyx_t_3 = PySequence_List(__pyx_v_allvariables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_3 = PySequence_List(__pyx_v_allvariables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_variables, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":280 + /* "constraint/problem.py":283 * # add regular constraints * for constraint, variables in self._constraints: * if not variables: # <<<<<<<<<<<<<< @@ -8077,25 +8169,25 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE */ } - /* "constraint/problem.py":282 + /* "constraint/problem.py":285 * if not variables: * variables = list(allvariables) * constraints.append((constraint, variables)) # <<<<<<<<<<<<<< * * # check if there are any precompiled FunctionConstraints when there shouldn't be */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_constraint); __Pyx_GIVEREF(__pyx_v_constraint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 282, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 285, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 282, __pyx_L1_error); - __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_constraints, __pyx_t_3); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 282, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 285, __pyx_L1_error); + __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_constraints, __pyx_t_3); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":279 + /* "constraint/problem.py":282 * * # add regular constraints * for constraint, variables in self._constraints: # <<<<<<<<<<<<<< @@ -8105,17 +8197,17 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":285 + /* "constraint/problem.py":288 * * # check if there are any precompiled FunctionConstraints when there shouldn't be * if picklable: # <<<<<<<<<<<<<< * assert not any(isinstance(c, FunctionConstraint) for c, _ in constraints), f"You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why)" # noqa E501 * */ - __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 288, __pyx_L1_error) if (__pyx_t_15) { - /* "constraint/problem.py":286 + /* "constraint/problem.py":289 * # check if there are any precompiled FunctionConstraints when there shouldn't be * if picklable: * assert not any(isinstance(c, FunctionConstraint) for c, _ in constraints), f"You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why)" # noqa E501 # <<<<<<<<<<<<<< @@ -8124,24 +8216,24 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = __pyx_pf_10constraint_7problem_7Problem_8_getArgs_genexpr(NULL, __pyx_v_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10constraint_7problem_7Problem_8_getArgs_genexpr(NULL, __pyx_v_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (!__pyx_t_15); if (unlikely(!__pyx_t_6)) { - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_You_have_used_FunctionConstraint, 0, 0); - __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_You_have_used_FunctionConstraint, 0, 0); + __PYX_ERR(0, 289, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 286, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 289, __pyx_L1_error) #endif - /* "constraint/problem.py":285 + /* "constraint/problem.py":288 * * # check if there are any precompiled FunctionConstraints when there shouldn't be * if picklable: # <<<<<<<<<<<<<< @@ -8150,19 +8242,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE */ } - /* "constraint/problem.py":288 + /* "constraint/problem.py":291 * assert not any(isinstance(c, FunctionConstraint) for c, _ in constraints), f"You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why)" # noqa E501 * * vconstraints = {} # <<<<<<<<<<<<<< * for variable in domains: * vconstraints[variable] = [] */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_vconstraints = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":289 + /* "constraint/problem.py":292 * * vconstraints = {} * for variable in domains: # <<<<<<<<<<<<<< @@ -8174,9 +8266,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __pyx_t_5 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_domains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_domains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 292, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -8184,17 +8276,17 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 289, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 292, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 289, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 292, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } @@ -8205,13 +8297,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_5; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 289, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 292, __pyx_L1_error) PyErr_Clear(); } break; @@ -8221,19 +8313,19 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":290 + /* "constraint/problem.py":293 * vconstraints = {} * for variable in domains: * vconstraints[variable] = [] # <<<<<<<<<<<<<< * for constraint, variables in constraints: * for variable in variables: */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_vconstraints, __pyx_v_variable, __pyx_t_1) < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_vconstraints, __pyx_v_variable, __pyx_t_1) < 0))) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":289 + /* "constraint/problem.py":292 * * vconstraints = {} * for variable in domains: # <<<<<<<<<<<<<< @@ -8243,7 +8335,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":291 + /* "constraint/problem.py":294 * for variable in domains: * vconstraints[variable] = [] * for constraint, variables in constraints: # <<<<<<<<<<<<<< @@ -8256,13 +8348,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 291, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 294, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; @@ -8270,7 +8362,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 291, __pyx_L1_error) + __PYX_ERR(0, 294, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8279,23 +8371,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -8303,7 +8395,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_8 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L24_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < 0) __PYX_ERR(0, 291, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 294, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L25_unpacking_done; @@ -8311,7 +8403,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 291, __pyx_L1_error) + __PYX_ERR(0, 294, __pyx_L1_error) __pyx_L25_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); @@ -8319,7 +8411,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":292 + /* "constraint/problem.py":295 * vconstraints[variable] = [] * for constraint, variables in constraints: * for variable in variables: # <<<<<<<<<<<<<< @@ -8331,9 +8423,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __pyx_t_11 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -8341,17 +8433,17 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 292, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 295, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_11); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 292, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 295, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } @@ -8362,13 +8454,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE #endif ++__pyx_t_11; } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 292, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 295, __pyx_L1_error) } else { __pyx_t_8 = __pyx_t_7(__pyx_t_1); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 292, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 295, __pyx_L1_error) PyErr_Clear(); } break; @@ -8378,28 +8470,28 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":293 + /* "constraint/problem.py":296 * for constraint, variables in constraints: * for variable in variables: * vconstraints[variable].append((constraint, variables)) # <<<<<<<<<<<<<< * for constraint, variables in constraints[:]: * constraint.preProcess(variables, domains, constraints, vconstraints) */ - __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_constraint); __Pyx_GIVEREF(__pyx_v_constraint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 293, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 296, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 293, __pyx_L1_error); - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_t_2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 293, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 296, __pyx_L1_error); + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_t_2); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":292 + /* "constraint/problem.py":295 * vconstraints[variable] = [] * for constraint, variables in constraints: * for variable in variables: # <<<<<<<<<<<<<< @@ -8409,7 +8501,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":291 + /* "constraint/problem.py":294 * for variable in domains: * vconstraints[variable] = [] * for constraint, variables in constraints: # <<<<<<<<<<<<<< @@ -8419,14 +8511,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":294 + /* "constraint/problem.py":297 * for variable in variables: * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: # <<<<<<<<<<<<<< * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): */ - __pyx_t_3 = __Pyx_PyList_GetSlice(__pyx_v_constraints, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetSlice(__pyx_v_constraints, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; @@ -8435,13 +8527,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 294, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 297, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; @@ -8449,7 +8541,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 294, __pyx_L1_error) + __PYX_ERR(0, 297, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -8458,23 +8550,23 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } #else - __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -8482,7 +8574,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_8 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L32_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < 0) __PYX_ERR(0, 294, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < (0)) __PYX_ERR(0, 297, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L33_unpacking_done; @@ -8490,7 +8582,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 294, __pyx_L1_error) + __PYX_ERR(0, 297, __pyx_L1_error) __pyx_L33_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); @@ -8498,7 +8590,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":295 + /* "constraint/problem.py":298 * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: * constraint.preProcess(variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< @@ -8510,14 +8602,14 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __pyx_t_4 = 0; { PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_preProcess, __pyx_callargs+__pyx_t_4, (5-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_preProcess, __pyx_callargs+__pyx_t_4, (5-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":294 + /* "constraint/problem.py":297 * for variable in variables: * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: # <<<<<<<<<<<<<< @@ -8527,7 +8619,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":296 + /* "constraint/problem.py":299 * for constraint, variables in constraints[:]: * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): # <<<<<<<<<<<<<< @@ -8537,9 +8629,9 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __pyx_t_5 = 0; if (unlikely(__pyx_v_domains == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); - __PYX_ERR(0, 296, __pyx_L1_error) + __PYX_ERR(0, 299, __pyx_L1_error) } - __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_domains, 0, __pyx_mstate_global->__pyx_n_u_values, (&__pyx_t_11), (&__pyx_t_17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_domains, 0, __pyx_mstate_global->__pyx_n_u_values, (&__pyx_t_11), (&__pyx_t_17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_3; @@ -8547,12 +8639,12 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE while (1) { __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_11, &__pyx_t_5, NULL, &__pyx_t_3, NULL, __pyx_t_17); if (unlikely(__pyx_t_18 == 0)) break; - if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 296, __pyx_L1_error) + if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":297 + /* "constraint/problem.py":300 * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): * domain.resetState() # <<<<<<<<<<<<<< @@ -8564,25 +8656,25 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_resetState, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_resetState, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":298 + /* "constraint/problem.py":301 * for domain in domains.values(): * domain.resetState() * if not domain: # <<<<<<<<<<<<<< * return None, None, None * # doArc8(getArcs(domains, constraints), domains, {}) */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 301, __pyx_L1_error) __pyx_t_15 = (!__pyx_t_6); if (__pyx_t_15) { - /* "constraint/problem.py":299 + /* "constraint/problem.py":302 * domain.resetState() * if not domain: * return None, None, None # <<<<<<<<<<<<<< @@ -8595,7 +8687,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":298 + /* "constraint/problem.py":301 * for domain in domains.values(): * domain.resetState() * if not domain: # <<<<<<<<<<<<<< @@ -8606,28 +8698,28 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":301 + /* "constraint/problem.py":304 * return None, None, None * # doArc8(getArcs(domains, constraints), domains, {}) * return domains, constraints, vconstraints # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_domains); __Pyx_GIVEREF(__pyx_v_domains); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domains) != (0)) __PYX_ERR(0, 301, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domains) != (0)) __PYX_ERR(0, 304, __pyx_L1_error); __Pyx_INCREF(__pyx_v_constraints); __Pyx_GIVEREF(__pyx_v_constraints); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_constraints) != (0)) __PYX_ERR(0, 301, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_constraints) != (0)) __PYX_ERR(0, 304, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vconstraints); __Pyx_GIVEREF(__pyx_v_vconstraints); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_vconstraints) != (0)) __PYX_ERR(0, 301, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_vconstraints) != (0)) __PYX_ERR(0, 304, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":265 + /* "constraint/problem.py":268 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< @@ -8668,30 +8760,33 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct__genexpr(PyObject *o) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct__genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -8701,19 +8796,24 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct__genexpr(P Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_c); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct__genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -8743,7 +8843,7 @@ static PyType_Spec __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr_ "constraint.problem.__pyx_scope_struct__genexpr", sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr_slots, }; #else @@ -8754,12 +8854,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct__genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -8773,7 +8868,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct__genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -8808,7 +8903,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -8828,30 +8923,33 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList[--__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList(PyObject *o) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -8860,19 +8958,24 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_1_getSolut PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_get_in_order); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList[__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -8909,7 +9012,7 @@ static PyType_Spec __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolu "constraint.problem.__pyx_scope_struct_1_getSolutionsOrderedList", sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList_slots, }; #else @@ -8920,12 +9023,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSol sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -8939,7 +9037,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSol 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList, /*tp_traverse*/ __pyx_tp_clear_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList, /*tp_clear*/ @@ -8974,7 +9072,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSol #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -8994,30 +9092,33 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSol static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_2_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_2_genexpr(PyObject *o) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_2_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -9027,19 +9128,24 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_2_genexpr( Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_solution); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_2_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -9069,7 +9175,7 @@ static PyType_Spec __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr "constraint.problem.__pyx_scope_struct_2_genexpr", sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr_slots, }; #else @@ -9080,12 +9186,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexp sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_2_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -9099,7 +9200,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexp 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct_2_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -9134,7 +9235,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexp #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -9154,30 +9255,33 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexp static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_3_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_3_genexpr(PyObject *o) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_3_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -9188,19 +9292,24 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_3_genexpr( Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_params); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_3_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -9233,7 +9342,7 @@ static PyType_Spec __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr "constraint.problem.__pyx_scope_struct_3_genexpr", sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr_slots, }; #else @@ -9244,12 +9353,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexp sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -9263,7 +9367,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexp 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct_3_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -9298,7 +9402,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexp #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -9318,30 +9422,33 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexp static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_4_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_4_genexpr(PyObject *o) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_4_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -9352,19 +9459,24 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_4_genexpr( Py_CLEAR(p->__pyx_v__); Py_CLEAR(p->__pyx_v_c); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_4_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -9397,7 +9509,7 @@ static PyType_Spec __pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr "constraint.problem.__pyx_scope_struct_4_genexpr", sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr_slots, }; #else @@ -9408,12 +9520,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_4_genexp sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -9427,7 +9534,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_4_genexp 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct_4_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -9462,7 +9569,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_4_genexp #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -9534,15 +9641,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr)) __PYX_ERR(0, 162, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr)) __PYX_ERR(0, 163, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr) < (0)) __PYX_ERR(0, 163, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr) < (0)) __PYX_ERR(0, 163, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -9550,15 +9660,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)) __PYX_ERR(0, 237, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList) < 0) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)) __PYX_ERR(0, 238, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList) < (0)) __PYX_ERR(0, 238, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList = &__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList) < 0) __PYX_ERR(0, 237, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList) < (0)) __PYX_ERR(0, 238, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_getattro == PyObject_GenericGetAttr)) { @@ -9566,15 +9679,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 241, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 242, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(0, 242, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 241, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr) < (0)) __PYX_ERR(0, 242, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -9582,15 +9698,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 243, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 244, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(0, 244, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 243, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(0, 244, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -9598,15 +9717,18 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 286, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 289, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(0, 289, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 286, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr) < (0)) __PYX_ERR(0, 289, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -9654,7 +9776,7 @@ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_problem}, #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - {Py_mod_gil, Py_MOD_GIL_USED}, + {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE}, #endif #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, @@ -9716,7 +9838,8 @@ __Pyx_PyMODINIT_FUNC PyInit_problem(void) return PyModuleDef_Init(&__pyx_moduledef); } /* ModuleCreationPEP489 */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ + || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { { PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think @@ -9746,12 +9869,15 @@ static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { #if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { static PY_INT64_T main_interpreter_id = -1; -#if CYTHON_COMPILING_IN_GRAAL +#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 + PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#elif CYTHON_COMPILING_IN_GRAAL PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000 - PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API +#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ + || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#elif CYTHON_COMPILING_IN_LIMITED_API + PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); #else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); #endif @@ -9823,12 +9949,15 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_problem(PyObject *__pyx_pyinit_mod __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - size_t __pyx_t_7; - int __pyx_t_8; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + size_t __pyx_t_9; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -9871,48 +10000,28 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_problem(PyObject *__pyx_pyinit_mod if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /* ImportRefnannyAPI */ #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - -__Pyx_RefNannySetupContext("PyInit_problem", 0); - if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } #endif + +__Pyx_RefNannySetupContext("PyInit_problem", 0); + __Pyx_init_runtime_version(); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Library function declarations ---*/ /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED) - if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ + if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error) if (__pyx_module_is_main_constraint__problem) { - if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) } { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -9921,10 +10030,10 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); } } /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(__pyx_mstate); (void)__Pyx_modinit_variable_export_code(__pyx_mstate); @@ -9939,188 +10048,185 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); * """Module containing the code for problem definitions.""" * * import copy # <<<<<<<<<<<<<< - * from warnings import warn + * from collections.abc import Callable, Hashable, Sequence * from operator import itemgetter */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_copy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_copy, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_2) < (0)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":4 * * import copy - * from warnings import warn # <<<<<<<<<<<<<< + * from collections.abc import Callable, Hashable, Sequence # <<<<<<<<<<<<<< * from operator import itemgetter - * from typing import Callable, Optional, Union + * from warnings import warn */ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_warnings, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Callable,__pyx_mstate_global->__pyx_n_u_Hashable,__pyx_mstate_global->__pyx_n_u_Sequence}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_imported_names, 3, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_warn, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Callable,__pyx_mstate_global->__pyx_n_u_Hashable,__pyx_mstate_global->__pyx_n_u_Sequence}; + for (__pyx_t_3=0; __pyx_t_3 < 3; __pyx_t_3++) { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/problem.py":5 * import copy - * from warnings import warn + * from collections.abc import Callable, Hashable, Sequence * from operator import itemgetter # <<<<<<<<<<<<<< - * from typing import Callable, Optional, Union - * from collections.abc import Sequence, Hashable -*/ - __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_itemgetter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_operator, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_itemgetter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_itemgetter, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "constraint/problem.py":6 * from warnings import warn - * from operator import itemgetter - * from typing import Callable, Optional, Union # <<<<<<<<<<<<<< - * from collections.abc import Sequence, Hashable * */ - __pyx_t_2 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_Callable, __pyx_mstate_global->__pyx_n_u_Optional, __pyx_mstate_global->__pyx_n_u_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Callable, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Optional); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Optional, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_itemgetter}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_operator, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Union, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_itemgetter}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":7 + /* "constraint/problem.py":6 + * from collections.abc import Callable, Hashable, Sequence * from operator import itemgetter - * from typing import Callable, Optional, Union - * from collections.abc import Sequence, Hashable # <<<<<<<<<<<<<< + * from warnings import warn # <<<<<<<<<<<<<< * - * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint + * from constraint.constraints import CompilableFunctionConstraint, Constraint, FunctionConstraint */ - __pyx_t_3 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_Sequence, __pyx_mstate_global->__pyx_n_u_Hashable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_warn}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_warnings, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Sequence); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Sequence, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Hashable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Hashable, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_warn}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":9 - * from collections.abc import Sequence, Hashable + /* "constraint/problem.py":8 + * from warnings import warn * - * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint # <<<<<<<<<<<<<< + * from constraint.constraints import CompilableFunctionConstraint, Constraint, FunctionConstraint # <<<<<<<<<<<<<< * from constraint.domain import Domain - * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver + * from constraint.parser import compile_to_constraints */ - __pyx_t_2 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint,__pyx_mstate_global->__pyx_n_u_Constraint,__pyx_mstate_global->__pyx_n_u_FunctionConstraint}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_imported_names, 3, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint,__pyx_mstate_global->__pyx_n_u_Constraint,__pyx_mstate_global->__pyx_n_u_FunctionConstraint}; + for (__pyx_t_3=0; __pyx_t_3 < 3; __pyx_t_3++) { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 8, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":10 + /* "constraint/problem.py":9 * - * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint + * from constraint.constraints import CompilableFunctionConstraint, Constraint, FunctionConstraint * from constraint.domain import Domain # <<<<<<<<<<<<<< - * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver * from constraint.parser import compile_to_constraints + * from constraint.solvers import OptimizedBacktrackingSolver, ParallelSolver, Solver */ - __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Domain}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Domain, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Domain}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 9, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":11 - * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint + /* "constraint/problem.py":10 + * from constraint.constraints import CompilableFunctionConstraint, Constraint, FunctionConstraint * from constraint.domain import Domain - * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver # <<<<<<<<<<<<<< - * from constraint.parser import compile_to_constraints + * from constraint.parser import compile_to_constraints # <<<<<<<<<<<<<< + * from constraint.solvers import OptimizedBacktrackingSolver, ParallelSolver, Solver * */ - __pyx_t_2 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_Solver, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, __pyx_mstate_global->__pyx_n_u_ParallelSolver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Solver, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ParallelSolver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_compile_to_constraints}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ParallelSolver, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_compile_to_constraints}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":12 + /* "constraint/problem.py":11 * from constraint.domain import Domain - * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver - * from constraint.parser import compile_to_constraints # <<<<<<<<<<<<<< + * from constraint.parser import compile_to_constraints + * from constraint.solvers import OptimizedBacktrackingSolver, ParallelSolver, Solver # <<<<<<<<<<<<<< * * try: */ - __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_compile_to_constraints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver,__pyx_mstate_global->__pyx_n_u_ParallelSolver,__pyx_mstate_global->__pyx_n_u_Solver}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_imported_names, 3, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_compile_to_constraints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver,__pyx_mstate_global->__pyx_n_u_ParallelSolver,__pyx_mstate_global->__pyx_n_u_Solver}; + for (__pyx_t_3=0; __pyx_t_3 < 3; __pyx_t_3++) { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":14 - * from constraint.parser import compile_to_constraints + /* "constraint/problem.py":13 + * from constraint.solvers import OptimizedBacktrackingSolver, ParallelSolver, Solver * * try: # <<<<<<<<<<<<<< * from sys import _is_gil_enabled @@ -10129,54 +10235,60 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5); + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { - /* "constraint/problem.py":15 + /* "constraint/problem.py":14 * * try: * from sys import _is_gil_enabled # <<<<<<<<<<<<<< * freethreading = _is_gil_enabled() * except ImportError: */ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_is_gil_enabled); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L2_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sys, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L2_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_is_gil_enabled); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L2_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_is_gil_enabled}; + __pyx_t_7 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sys, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 14, __pyx_L2_error) + } + __pyx_t_2 = __pyx_t_7; __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_gil_enabled, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L2_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_is_gil_enabled}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 14, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 14, __pyx_L2_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":16 + /* "constraint/problem.py":15 * try: * from sys import _is_gil_enabled * freethreading = _is_gil_enabled() # <<<<<<<<<<<<<< * except ImportError: * freethreading = False */ - __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_is_gil_enabled); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 16, __pyx_L2_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = 1; + __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_is_gil_enabled); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 15, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 16, __pyx_L2_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_2); } - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_freethreading, __pyx_t_3) < 0) __PYX_ERR(0, 16, __pyx_L2_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_freethreading, __pyx_t_2) < (0)) __PYX_ERR(0, 15, __pyx_L2_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":14 - * from constraint.parser import compile_to_constraints + /* "constraint/problem.py":13 + * from constraint.solvers import OptimizedBacktrackingSolver, ParallelSolver, Solver * * try: # <<<<<<<<<<<<<< * from sys import _is_gil_enabled @@ -10184,46 +10296,46 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_try_end; __pyx_L2_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":17 + /* "constraint/problem.py":16 * from sys import _is_gil_enabled * freethreading = _is_gil_enabled() * except ImportError: # <<<<<<<<<<<<<< * freethreading = False * */ - __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); - if (__pyx_t_8) { + __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_ImportError)))); + if (__pyx_t_10) { __Pyx_AddTraceback("constraint.problem", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L4_except_error) - __Pyx_XGOTREF(__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_6); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_8, &__pyx_t_4) < 0) __PYX_ERR(0, 16, __pyx_L4_except_error) __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_4); - /* "constraint/problem.py":18 + /* "constraint/problem.py":17 * freethreading = _is_gil_enabled() * except ImportError: * freethreading = False # <<<<<<<<<<<<<< * * */ - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_freethreading, Py_False) < 0) __PYX_ERR(0, 18, __pyx_L4_except_error) - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_freethreading, Py_False) < (0)) __PYX_ERR(0, 17, __pyx_L4_except_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3_exception_handled; } goto __pyx_L4_except_error; - /* "constraint/problem.py":14 - * from constraint.parser import compile_to_constraints + /* "constraint/problem.py":13 + * from constraint.solvers import OptimizedBacktrackingSolver, ParallelSolver, Solver * * try: # <<<<<<<<<<<<<< * from sys import _is_gil_enabled @@ -10231,262 +10343,319 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); */ __pyx_L4_except_error:; __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L3_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_5, __pyx_t_6); __pyx_L7_try_end:; } - /* "constraint/problem.py":21 + /* "constraint/problem.py":20 * * * class Problem: # <<<<<<<<<<<<<< * """Class used to define a problem and retrieve solutions.""" * */ - __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Problem, __pyx_mstate_global->__pyx_n_u_Problem, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_kp_u_Class_used_to_define_a_problem_a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Problem, __pyx_mstate_global->__pyx_n_u_Problem, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_kp_u_Class_used_to_define_a_problem_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); - /* "constraint/problem.py":24 + /* "constraint/problem.py":23 * """Class used to define a problem and retrieve solutions.""" * * def __init__(self, solver: Solver=None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_solver, __pyx_mstate_global->__pyx_n_u_Solver) < 0) __PYX_ERR(0, 24, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Problem___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_solver, __pyx_mstate_global->__pyx_n_u_Solver) < (0)) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Problem___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < (0)) __PYX_ERR(0, 23, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":44 + /* "constraint/problem.py":43 * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") * * def reset(self): # <<<<<<<<<<<<<< * """Reset the current problem definition. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_3reset, 0, __pyx_mstate_global->__pyx_n_u_Problem_reset, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_3reset, 0, __pyx_mstate_global->__pyx_n_u_Problem_reset, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_2) < (0)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":57 + /* "constraint/problem.py":56 * self._variables.clear() * * def setSolver(self, solver): # <<<<<<<<<<<<<< * """Change the problem solver currently in use. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_5setSolver, 0, __pyx_mstate_global->__pyx_n_u_Problem_setSolver, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_setSolver, __pyx_t_3) < 0) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_5setSolver, 0, __pyx_mstate_global->__pyx_n_u_Problem_setSolver, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_setSolver, __pyx_t_2) < (0)) __PYX_ERR(0, 56, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":72 + /* "constraint/problem.py":71 * self._solver = solver * * def getSolver(self): # <<<<<<<<<<<<<< * """Obtain the problem solver currently in use. * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_7getSolver, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolver, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolver, __pyx_t_3) < 0) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_7getSolver, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolver, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolver, __pyx_t_2) < (0)) __PYX_ERR(0, 71, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":86 + /* "constraint/problem.py":85 * return self._solver * * def addVariable(self, variable: Hashable, domain): # <<<<<<<<<<<<<< * """Add a variable to the problem. * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variable, __pyx_mstate_global->__pyx_n_u_Hashable) < 0) __PYX_ERR(0, 86, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_9addVariable, 0, __pyx_mstate_global->__pyx_n_u_Problem_addVariable, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_addVariable, __pyx_t_6) < 0) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variable, __pyx_mstate_global->__pyx_n_u_Hashable) < (0)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_9addVariable, 0, __pyx_mstate_global->__pyx_n_u_Problem_addVariable, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_addVariable, __pyx_t_8) < (0)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":116 + /* "constraint/problem.py":117 * self._variables[variable] = domain * * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< * """Add one or more variables to the problem. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables_2, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 116, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_11addVariables, 0, __pyx_mstate_global->__pyx_n_u_Problem_addVariables, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_addVariables, __pyx_t_3) < 0) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_variables_2, __pyx_mstate_global->__pyx_n_u_Sequence) < (0)) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_11addVariables, 0, __pyx_mstate_global->__pyx_n_u_Problem_addVariables, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_addVariables, __pyx_t_2) < (0)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":139 + /* "constraint/problem.py":140 * self.addVariable(variable, domain) * - * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * def addConstraint(self, constraint: Constraint | Callable | str, variables: Sequence | None = None): # <<<<<<<<<<<<<< * """Add a constraint to the problem. * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_constraint, __pyx_mstate_global->__pyx_kp_u_Union_Constraint_Callable_str) < 0) __PYX_ERR(0, 139, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables_2, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 139, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_13addConstraint, 0, __pyx_mstate_global->__pyx_n_u_Problem_addConstraint, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_addConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 139, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraint, __pyx_mstate_global->__pyx_kp_u_Constraint_Callable_str) < (0)) __PYX_ERR(0, 140, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables_2, __pyx_mstate_global->__pyx_kp_u_Sequence_None) < (0)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_13addConstraint, 0, __pyx_mstate_global->__pyx_n_u_Problem_addConstraint, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_addConstraint, __pyx_t_8) < (0)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":178 + /* "constraint/problem.py":179 * self._constraints.append((constraint, variables)) * * def getSolution(self): # <<<<<<<<<<<<<< * """Find and return a solution to the problem. * */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_15getSolution, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_6) < 0) __PYX_ERR(0, 178, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_15getSolution, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8); + #endif + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_8) < (0)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":197 + /* "constraint/problem.py":198 * return self._solver.getSolution(domains, constraints, vconstraints) * * def getSolutions(self): # <<<<<<<<<<<<<< * """Find and return all solutions to the problem. * */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_17getSolutions, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolutions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_6) < 0) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_17getSolutions, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolutions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8); + #endif + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_8) < (0)) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":216 + /* "constraint/problem.py":217 * return self._solver.getSolutions(domains, constraints, vconstraints) * * def getSolutionIter(self): # <<<<<<<<<<<<<< * """Return an iterator to the solutions of the problem. * */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_19getSolutionIter, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionIter, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_6) < 0) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_19getSolutionIter, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionIter, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8); + #endif + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_8) < (0)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":237 + /* "constraint/problem.py":238 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< * """Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`.""" * solutions: list[dict] = self.getSolutions() */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_order, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 237, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 237, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_21getSolutionsOrderedList, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionsOrderedList_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutionsOrderedList, __pyx_t_3) < 0) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_order, __pyx_mstate_global->__pyx_kp_u_list_str) < (0)) __PYX_ERR(0, 238, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 238, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_21getSolutionsOrderedList, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionsOrderedList_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolutionsOrderedList, __pyx_t_2) < (0)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":245 + /* "constraint/problem.py":247 + * + * def getSolutionsAsListDict( + * self, order: list[str] = None, validate: bool = True # <<<<<<<<<<<<<< + * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 + * """Returns the searchspace as a list of tuples, a dict of the searchspace for fast lookups and the size.""" +*/ + __pyx_t_2 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "constraint/problem.py":246 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< * self, order: list[str] = None, validate: bool = True * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_order, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 245, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_validate, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 245, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_list_tuple_dict_tuple_int) < 0) __PYX_ERR(0, 245, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_23getSolutionsAsListDict, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionsAsListDict, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[2]); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutionsAsListDict, __pyx_t_6) < 0) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = PyTuple_Pack(2, Py_None, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_order, __pyx_mstate_global->__pyx_kp_u_list_str) < (0)) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_validate, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_list_tuple_dict_tuple_int) < (0)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_23getSolutionsAsListDict, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionsAsListDict, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_t_8); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolutionsAsListDict, __pyx_t_11) < (0)) __PYX_ERR(0, 246, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "constraint/problem.py":265 + /* "constraint/problem.py":268 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< * domains = self._variables.copy() * allvariables = domains.keys() */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_25_getArgs, 0, __pyx_mstate_global->__pyx_n_u_Problem__getArgs, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3]); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getArgs, __pyx_t_6) < 0) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_25_getArgs, 0, __pyx_mstate_global->__pyx_n_u_Problem__getArgs, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[2]); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getArgs, __pyx_t_11) < (0)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "constraint/problem.py":21 + /* "constraint/problem.py":20 * * * class Problem: # <<<<<<<<<<<<<< * """Class used to define a problem and retrieve solutions.""" * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Problem, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Problem, __pyx_t_6) < 0) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_11 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Problem, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Problem, __pyx_t_11) < (0)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/problem.py":1 * """Module containing the code for problem definitions.""" # <<<<<<<<<<<<<< * * import copy */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Problem_reset_line_44, __pyx_mstate_global->__pyx_kp_u_Reset_the_current_problem_defini) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Problem_setSolver_line_57, __pyx_mstate_global->__pyx_kp_u_Change_the_problem_solver_curren) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Problem_getSolver_line_72, __pyx_mstate_global->__pyx_kp_u_Obtain_the_problem_solver_curren) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Problem_addVariable_line_86, __pyx_mstate_global->__pyx_kp_u_Add_a_variable_to_the_problem_Ex) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Problem_addVariables_line_116, __pyx_mstate_global->__pyx_kp_u_Add_one_or_more_variables_to_the) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Problem_addConstraint_line_139, __pyx_mstate_global->__pyx_kp_u_Add_a_constraint_to_the_problem) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Problem_getSolution_line_178, __pyx_mstate_global->__pyx_kp_u_Find_and_return_a_solution_to_th) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Problem_getSolutions_line_197, __pyx_mstate_global->__pyx_kp_u_Find_and_return_all_solutions_to) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Problem_getSolutionIter_line_216, __pyx_mstate_global->__pyx_kp_u_Return_an_iterator_to_the_soluti) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Problem_reset_line_43, __pyx_mstate_global->__pyx_kp_u_Reset_the_current_problem_defini) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Problem_setSolver_line_56, __pyx_mstate_global->__pyx_kp_u_Change_the_problem_solver_curren) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Problem_getSolver_line_71, __pyx_mstate_global->__pyx_kp_u_Obtain_the_problem_solver_curren) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Problem_addVariable_line_85, __pyx_mstate_global->__pyx_kp_u_Add_a_variable_to_the_problem_Ex) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Problem_addVariables_line_117, __pyx_mstate_global->__pyx_kp_u_Add_one_or_more_variables_to_the) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Problem_addConstraint_line_140, __pyx_mstate_global->__pyx_kp_u_Add_a_constraint_to_the_problem) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Problem_getSolution_line_179, __pyx_mstate_global->__pyx_kp_u_Find_and_return_a_solution_to_th) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Problem_getSolutions_line_198, __pyx_mstate_global->__pyx_kp_u_Find_and_return_all_solutions_to) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Problem_getSolutionIter_line_217, __pyx_mstate_global->__pyx_kp_u_Return_an_iterator_to_the_soluti) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_11); if (__pyx_m) { if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init constraint.problem", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -10514,221 +10683,19 @@ __Pyx_RefNannySetupContext("PyInit_problem", 0); #endif } /* #### Code section: pystring_table ### */ - -typedef struct { - const char *s; -#if 1036 <= 65535 - const unsigned short n; -#elif 1036 / 2 < INT_MAX - const unsigned int n; -#elif 1036 / 2 < LONG_MAX - const unsigned long n; -#else - const Py_ssize_t n; -#endif -#if 1 <= 31 - const unsigned int encoding : 5; -#elif 1 <= 255 - const unsigned char encoding; -#elif 1 <= 65535 - const unsigned short encoding; -#else - const Py_ssize_t encoding; -#endif - const unsigned int is_unicode : 1; - const unsigned int intern : 1; -} __Pyx_StringTabEntry; -static const char * const __pyx_string_tab_encodings[] = { 0 }; -static const __Pyx_StringTabEntry __pyx_string_tab[] = { - {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ - {__pyx_k_Add_a_constraint_to_the_problem, sizeof(__pyx_k_Add_a_constraint_to_the_problem), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Add_a_constraint_to_the_problem */ - {__pyx_k_Add_a_variable_to_the_problem_Ex, sizeof(__pyx_k_Add_a_variable_to_the_problem_Ex), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Add_a_variable_to_the_problem_Ex */ - {__pyx_k_Add_one_or_more_variables_to_the, sizeof(__pyx_k_Add_one_or_more_variables_to_the), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Add_one_or_more_variables_to_the */ - {__pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AssertionError */ - {__pyx_k_Callable, sizeof(__pyx_k_Callable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Callable */ - {__pyx_k_Change_the_problem_solver_curren, sizeof(__pyx_k_Change_the_problem_solver_curren), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Change_the_problem_solver_curren */ - {__pyx_k_Class_used_to_define_a_problem_a, sizeof(__pyx_k_Class_used_to_define_a_problem_a), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Class_used_to_define_a_problem_a */ - {__pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CompilableFunctionConstraint */ - {__pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint */ - {__pyx_k_Constraints_must_be_instances_of, sizeof(__pyx_k_Constraints_must_be_instances_of), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraints_must_be_instances_of */ - {__pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain */ - {__pyx_k_Domain_is_empty, sizeof(__pyx_k_Domain_is_empty), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Domain_is_empty */ - {__pyx_k_Domains_must_be_instances_of_sub, sizeof(__pyx_k_Domains_must_be_instances_of_sub), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Domains_must_be_instances_of_sub */ - {__pyx_k_Expected_constraints_to_be_strin, sizeof(__pyx_k_Expected_constraints_to_be_strin), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Expected_constraints_to_be_strin */ - {__pyx_k_Find_and_return_a_solution_to_th, sizeof(__pyx_k_Find_and_return_a_solution_to_th), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Find_and_return_a_solution_to_th */ - {__pyx_k_Find_and_return_all_solutions_to, sizeof(__pyx_k_Find_and_return_all_solutions_to), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Find_and_return_all_solutions_to */ - {__pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionConstraint */ - {__pyx_k_Hashable, sizeof(__pyx_k_Hashable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Hashable */ - {__pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ImportError */ - {__pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_None */ - {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ - {__pyx_k_Obtain_the_problem_solver_curren, sizeof(__pyx_k_Obtain_the_problem_solver_curren), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Obtain_the_problem_solver_curren */ - {__pyx_k_OptimizedBacktrackingSolver, sizeof(__pyx_k_OptimizedBacktrackingSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver */ - {__pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Optional */ - {__pyx_k_Optional_Sequence, sizeof(__pyx_k_Optional_Sequence), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Optional_Sequence */ - {__pyx_k_ParallelSolver, sizeof(__pyx_k_ParallelSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver */ - {__pyx_k_ParallelSolver_is_currently_expe, sizeof(__pyx_k_ParallelSolver_is_currently_expe), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ParallelSolver_is_currently_expe */ - {__pyx_k_Problem, sizeof(__pyx_k_Problem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem */ - {__pyx_k_Problem___init, sizeof(__pyx_k_Problem___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem___init */ - {__pyx_k_Problem__getArgs, sizeof(__pyx_k_Problem__getArgs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem__getArgs */ - {__pyx_k_Problem__getArgs_locals_genexpr, sizeof(__pyx_k_Problem__getArgs_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem__getArgs_locals_genexpr */ - {__pyx_k_Problem_addConstraint, sizeof(__pyx_k_Problem_addConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_addConstraint */ - {__pyx_k_Problem_addConstraint_line_139, sizeof(__pyx_k_Problem_addConstraint_line_139), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_addConstraint_line_139 */ - {__pyx_k_Problem_addConstraint_locals_gen, sizeof(__pyx_k_Problem_addConstraint_locals_gen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_addConstraint_locals_gen */ - {__pyx_k_Problem_addVariable, sizeof(__pyx_k_Problem_addVariable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_addVariable */ - {__pyx_k_Problem_addVariable_line_86, sizeof(__pyx_k_Problem_addVariable_line_86), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_addVariable_line_86 */ - {__pyx_k_Problem_addVariables, sizeof(__pyx_k_Problem_addVariables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_addVariables */ - {__pyx_k_Problem_addVariables_line_116, sizeof(__pyx_k_Problem_addVariables_line_116), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_addVariables_line_116 */ - {__pyx_k_Problem_getSolution, sizeof(__pyx_k_Problem_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolution */ - {__pyx_k_Problem_getSolutionIter, sizeof(__pyx_k_Problem_getSolutionIter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolutionIter */ - {__pyx_k_Problem_getSolutionIter_line_216, sizeof(__pyx_k_Problem_getSolutionIter_line_216), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolutionIter_line_216 */ - {__pyx_k_Problem_getSolution_line_178, sizeof(__pyx_k_Problem_getSolution_line_178), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolution_line_178 */ - {__pyx_k_Problem_getSolutions, sizeof(__pyx_k_Problem_getSolutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolutions */ - {__pyx_k_Problem_getSolutionsAsListDict, sizeof(__pyx_k_Problem_getSolutionsAsListDict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolutionsAsListDict */ - {__pyx_k_Problem_getSolutionsOrderedList, sizeof(__pyx_k_Problem_getSolutionsOrderedList), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolutionsOrderedList */ - {__pyx_k_Problem_getSolutionsOrderedList_2, sizeof(__pyx_k_Problem_getSolutionsOrderedList_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolutionsOrderedList_2 */ - {__pyx_k_Problem_getSolutions_line_197, sizeof(__pyx_k_Problem_getSolutions_line_197), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolutions_line_197 */ - {__pyx_k_Problem_getSolver, sizeof(__pyx_k_Problem_getSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolver */ - {__pyx_k_Problem_getSolver_line_72, sizeof(__pyx_k_Problem_getSolver_line_72), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolver_line_72 */ - {__pyx_k_Problem_reset, sizeof(__pyx_k_Problem_reset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_reset */ - {__pyx_k_Problem_reset_line_44, sizeof(__pyx_k_Problem_reset_line_44), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_reset_line_44 */ - {__pyx_k_Problem_setSolver, sizeof(__pyx_k_Problem_setSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_setSolver */ - {__pyx_k_Problem_setSolver_line_57, sizeof(__pyx_k_Problem_setSolver_line_57), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_setSolver_line_57 */ - {__pyx_k_Reset_the_current_problem_defini, sizeof(__pyx_k_Reset_the_current_problem_defini), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Reset_the_current_problem_defini */ - {__pyx_k_Return_an_iterator_to_the_soluti, sizeof(__pyx_k_Return_an_iterator_to_the_soluti), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_an_iterator_to_the_soluti */ - {__pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Sequence */ - {__pyx_k_Solver, sizeof(__pyx_k_Solver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Solver */ - {__pyx_k_Tried_to_insert_duplicated_varia, sizeof(__pyx_k_Tried_to_insert_duplicated_varia), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Tried_to_insert_duplicated_varia */ - {__pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TypeError */ - {__pyx_k_Union, sizeof(__pyx_k_Union), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Union */ - {__pyx_k_Union_Constraint_Callable_str, sizeof(__pyx_k_Union_Constraint_Callable_str), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Union_Constraint_Callable_str */ - {__pyx_k_Using_the_ParallelSolver_in_Thre, sizeof(__pyx_k_Using_the_ParallelSolver_in_Thre), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Using_the_ParallelSolver_in_Thre */ - {__pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ValueError */ - {__pyx_k_You_have_used_FunctionConstraint, sizeof(__pyx_k_You_have_used_FunctionConstraint), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_You_have_used_FunctionConstraint */ - {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ - {__pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__3 */ - {__pyx_k__6, sizeof(__pyx_k__6), 0, 1, 1}, /* PyObject cname: __pyx_n_u__6 */ - {__pyx_k_addConstraint, sizeof(__pyx_k_addConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_addConstraint */ - {__pyx_k_addVariable, sizeof(__pyx_k_addVariable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_addVariable */ - {__pyx_k_addVariables, sizeof(__pyx_k_addVariables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_addVariables */ - {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ - {__pyx_k_allvariables, sizeof(__pyx_k_allvariables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_allvariables */ - {__pyx_k_append, sizeof(__pyx_k_append), 0, 1, 1}, /* PyObject cname: __pyx_n_u_append */ - {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */ - {__pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bool */ - {__pyx_k_c, sizeof(__pyx_k_c), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c */ - {__pyx_k_clear, sizeof(__pyx_k_clear), 0, 1, 1}, /* PyObject cname: __pyx_n_u_clear */ - {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ - {__pyx_k_close, sizeof(__pyx_k_close), 0, 1, 1}, /* PyObject cname: __pyx_n_u_close */ - {__pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_collections_abc */ - {__pyx_k_compile_to_constraints, sizeof(__pyx_k_compile_to_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compile_to_constraints */ - {__pyx_k_constraint, sizeof(__pyx_k_constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint */ - {__pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_constraints */ - {__pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_domain */ - {__pyx_k_constraint_parser, sizeof(__pyx_k_constraint_parser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_parser */ - {__pyx_k_constraint_problem, sizeof(__pyx_k_constraint_problem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_problem */ - {__pyx_k_constraint_problem_py, sizeof(__pyx_k_constraint_problem_py), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_constraint_problem_py */ - {__pyx_k_constraint_solvers, sizeof(__pyx_k_constraint_solvers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_solvers */ - {__pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraints */ - {__pyx_k_constraints_2, sizeof(__pyx_k_constraints_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraints_2 */ - {__pyx_k_copy, sizeof(__pyx_k_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_copy */ - {__pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_deepcopy */ - {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */ - {__pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_doc */ - {__pyx_k_domain, sizeof(__pyx_k_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domain */ - {__pyx_k_domains, sizeof(__pyx_k_domains), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domains */ - {__pyx_k_duplicate_parameter_configurati, sizeof(__pyx_k_duplicate_parameter_configurati), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_duplicate_parameter_configurati */ - {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */ - {__pyx_k_extend, sizeof(__pyx_k_extend), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extend */ - {__pyx_k_freethreading, sizeof(__pyx_k_freethreading), 0, 1, 1}, /* PyObject cname: __pyx_n_u_freethreading */ - {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */ - {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */ - {__pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_genexpr */ - {__pyx_k_getArgs, sizeof(__pyx_k_getArgs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getArgs */ - {__pyx_k_getSolution, sizeof(__pyx_k_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolution */ - {__pyx_k_getSolutionIter, sizeof(__pyx_k_getSolutionIter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutionIter */ - {__pyx_k_getSolutions, sizeof(__pyx_k_getSolutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutions */ - {__pyx_k_getSolutionsAsListDict, sizeof(__pyx_k_getSolutionsAsListDict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutionsAsListDict */ - {__pyx_k_getSolutionsOrderedList, sizeof(__pyx_k_getSolutionsOrderedList), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutionsOrderedList */ - {__pyx_k_getSolver, sizeof(__pyx_k_getSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolver */ - {__pyx_k_get_in_order, sizeof(__pyx_k_get_in_order), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_in_order */ - {__pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getitem */ - {__pyx_k_init, sizeof(__pyx_k_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_init */ - {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */ - {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */ - {__pyx_k_is_gil_enabled, sizeof(__pyx_k_is_gil_enabled), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_gil_enabled */ - {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */ - {__pyx_k_itemgetter, sizeof(__pyx_k_itemgetter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_itemgetter */ - {__pyx_k_keys, sizeof(__pyx_k_keys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keys */ - {__pyx_k_list_str, sizeof(__pyx_k_list_str), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_str */ - {__pyx_k_list_tuple, sizeof(__pyx_k_list_tuple), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_tuple */ - {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ - {__pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaclass */ - {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ - {__pyx_k_msg, sizeof(__pyx_k_msg), 0, 1, 1}, /* PyObject cname: __pyx_n_u_msg */ - {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ - {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */ - {__pyx_k_operator, sizeof(__pyx_k_operator), 0, 1, 1}, /* PyObject cname: __pyx_n_u_operator */ - {__pyx_k_order, sizeof(__pyx_k_order), 0, 1, 1}, /* PyObject cname: __pyx_n_u_order */ - {__pyx_k_params, sizeof(__pyx_k_params), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params */ - {__pyx_k_parsed, sizeof(__pyx_k_parsed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parsed */ - {__pyx_k_picklable, sizeof(__pyx_k_picklable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_picklable */ - {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ - {__pyx_k_preProcess, sizeof(__pyx_k_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_preProcess */ - {__pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prepare */ - {__pyx_k_process_mode, sizeof(__pyx_k_process_mode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_process_mode */ - {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ - {__pyx_k_range, sizeof(__pyx_k_range), 0, 1, 1}, /* PyObject cname: __pyx_n_u_range */ - {__pyx_k_requires_pickling, sizeof(__pyx_k_requires_pickling), 0, 1, 1}, /* PyObject cname: __pyx_n_u_requires_pickling */ - {__pyx_k_reset, sizeof(__pyx_k_reset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reset */ - {__pyx_k_resetState, sizeof(__pyx_k_resetState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_resetState */ - {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */ - {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */ - {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */ - {__pyx_k_setSolver, sizeof(__pyx_k_setSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setSolver */ - {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */ - {__pyx_k_size_dict, sizeof(__pyx_k_size_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_size_dict */ - {__pyx_k_size_list, sizeof(__pyx_k_size_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_size_list */ - {__pyx_k_solution, sizeof(__pyx_k_solution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solution */ - {__pyx_k_solutions, sizeof(__pyx_k_solutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solutions */ - {__pyx_k_solutions_dict, sizeof(__pyx_k_solutions_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solutions_dict */ - {__pyx_k_solutions_list, sizeof(__pyx_k_solutions_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solutions_list */ - {__pyx_k_solver, sizeof(__pyx_k_solver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solver */ - {__pyx_k_solver_2, sizeof(__pyx_k_solver_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solver_2 */ - {__pyx_k_solver_is_not_instance_of_Solve, sizeof(__pyx_k_solver_is_not_instance_of_Solve), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_solver_is_not_instance_of_Solve */ - {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */ - {__pyx_k_str_constraints, sizeof(__pyx_k_str_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_str_constraints */ - {__pyx_k_sys, sizeof(__pyx_k_sys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sys */ - {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ - {__pyx_k_throw, sizeof(__pyx_k_throw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_throw */ - {__pyx_k_tuple_list_tuple_dict_tuple_int, sizeof(__pyx_k_tuple_list_tuple_dict_tuple_int), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_tuple_list_tuple_dict_tuple_int */ - {__pyx_k_typing, sizeof(__pyx_k_typing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_typing */ - {__pyx_k_v, sizeof(__pyx_k_v), 0, 1, 1}, /* PyObject cname: __pyx_n_u_v */ - {__pyx_k_validate, sizeof(__pyx_k_validate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_validate */ - {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ - {__pyx_k_values, sizeof(__pyx_k_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_values */ - {__pyx_k_variable, sizeof(__pyx_k_variable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable */ - {__pyx_k_variables, sizeof(__pyx_k_variables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables */ - {__pyx_k_variables_2, sizeof(__pyx_k_variables_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables_2 */ - {__pyx_k_vconstraints, sizeof(__pyx_k_vconstraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vconstraints */ - {__pyx_k_warn, sizeof(__pyx_k_warn), 0, 1, 1}, /* PyObject cname: __pyx_n_u_warn */ - {__pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_warnings */ - {__pyx_k_zip, sizeof(__pyx_k_zip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zip */ - {0, 0, 0, 0, 0} -}; -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); - /* #### Code section: cached_builtins ### */ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 17, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 36, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 104, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 111, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 251, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 252, __pyx_L1_error) + + /* Cached unbound methods */ + __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; + __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values; return 0; __pyx_L1_error:; return -1; @@ -10740,60 +10707,95 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "constraint/problem.py":54 + /* "constraint/problem.py":53 * >>> * """ * del self._constraints[:] # <<<<<<<<<<<<<< * self._variables.clear() * */ - __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); - /* "constraint/problem.py":299 + /* "constraint/problem.py":302 * domain.resetState() * if not domain: * return None, None, None # <<<<<<<<<<<<<< * # doArc8(getArcs(domains, constraints), domains, {}) * return domains, constraints, vconstraints */ - __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 299, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); - /* "constraint/problem.py":24 + /* "constraint/problem.py":23 * """Class used to define a problem and retrieve solutions.""" * * def __init__(self, solver: Solver=None): # <<<<<<<<<<<<<< * """Initialization method. * */ - __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); - /* "constraint/problem.py":245 - * return list(get_in_order(params) for params in solutions) - * - * def getSolutionsAsListDict( # <<<<<<<<<<<<<< - * self, order: list[str] = None, validate: bool = True - * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 -*/ - __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(2, Py_None, ((PyObject*)Py_True)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 245, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); - - /* "constraint/problem.py":265 + /* "constraint/problem.py":268 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< * domains = self._variables.copy() * allvariables = domains.keys() */ - __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); - __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); + __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_tuple; + for (Py_ssize_t i=0; i<3; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_slice; + for (Py_ssize_t i=0; i<1; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -10804,31 +10806,141 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; - if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + { + const struct { const unsigned int length: 10; } index[] = {{2},{1010},{514},{677},{335},{54},{27},{13},{67},{15},{59},{19},{40},{373},{393},{4},{179},{327},{127},{32},{29},{31},{34},{30},{31},{27},{23},{27},{235},{453},{15},{36},{94},{227},{2},{1},{1},{8},{21},{7},{43},{6},{2},{9},{9},{11},{45},{41},{8},{8},{28},{10},{6},{18},{8},{27},{14},{7},{16},{16},{33},{21},{38},{19},{20},{19},{23},{20},{30},{48},{31},{17},{13},{17},{20},{8},{6},{1},{13},{11},{12},{12},{12},{6},{18},{4},{1},{5},{18},{5},{15},{22},{10},{22},{17},{17},{18},{18},{12},{11},{4},{5},{8},{7},{6},{7},{6},{13},{8},{7},{8},{11},{15},{12},{22},{23},{9},{12},{11},{8},{13},{15},{10},{5},{4},{8},{13},{10},{3},{8},{4},{8},{5},{6},{6},{9},{3},{10},{11},{13},{12},{17},{5},{10},{6},{4},{4},{9},{12},{10},{9},{9},{8},{9},{14},{14},{6},{7},{16},{3},{8},{5},{1},{8},{5},{6},{8},{10},{9},{12},{4},{8},{3},{161},{22},{11},{55},{55},{60},{11},{175},{158},{2},{2},{2},{2},{25},{63},{278},{126}}; + #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (2981 bytes) */ +const char* const cstring = "(\265/\375`\367\037\335\\\000\312o\340\026F\340\2628\0070\314c-\306G\030B0\004\306\363D\236\2170\020\006\3020\004\331\022\203\376-E\332\02695H\333O!\023Wz\367\254J\"\322\255\312\030\241\212\023\302\215Y\325`\016\335\305HH\202\005,\224\356\274\255;\001?\001^\001\3405m)>\362 \"t\337\372g\334\375\305\337}\367]u\245\277j\215o\325\335\357\272\377e\306e\277\366\321[\357\333>\332\272Z:\367\375\317\036cs\237cc\351\311\n\375\227ax\250\370\210\007\311K)3EGH\024\n\355;w\306^\007\316\316\363\323\214\337\003\367\305\364\276\367.\236\331o\252\236\202\033\375\315\275J5}\246$\372\257\365\373u\310]\231\265\265\306\367\374\354t\375\206\213Y\033D\211B>=\327\277\363\344\364\351g\271[EZ\177\3168\005\2709}\317\233\271\306\177\343\356\247\362\321\314LI\353i\271\022\350\225\\\205\375\271;kH\257\262\351e\377\252\305\353\376,\326\236\337\205=\277\352G\364u\236\236\203\326N\256\342\375M\037\355\331e\254\362\325\255n\347\276\337\325\374\236\315{\005w\027\241\250x\013\t\337\350\235\216\242azK\213o^\332|4}\322\255\2336t\222\361\340#\025\037\221b|$\203\262\241\370\010e\242\304\204\364\254y\322\240tf\242\020\312[\234\004\t\022\245\267^7mP\370\201\003Y\367v\303\331\363gm\307\333\367\2553o}1\347\323)5e\242\370j\224\316\022\231\217D \253f\272\3460\255`\273\315z\016\270f\333\267\312<\016\034J\332\333\233\345/j\321\264~N\277k\262\374\3037\262\374\236g\254\277\311\355\377\254\362\375a\326\2565\376\024wn1F\321\371\231\005\343W\317\240\324w\376\232av\274xx\277dY\266\365\264\317}\366\255q\027\362\355\271\031\3326\177w\365B*\234\361\256~\247\277\014\021\210\017\332\303\n)\204\213E\204\210\020*+B\220\364\007\026\224\250\303\n\311\377\2422\375\237\326\237\375\365|\213\362LO\025M\265\367\033\351j\337\332\231'j\213\221\275\2663E\256\324S\300\255\315\215\357\235)\257\375\352\351\375\365\017\203\256Z\341\231\276u\333\372m+,+\033P(P~3h\177\317\374[\265OO\2771\014\223\376*\023#\023c\255\227\347\016$RC\204\322\263\342\0236\341\025B\266\306\021\260\r\257\023\322C\266\210,\341\306Q\000\022#\205%2R\345\203\03709%\030\010v\362\202!\2618!\\\020\002@\002\204\224\350\022\t]pDB\000\230\354\230|\230\306\217\330\n[\340|Z\"\220\216I$\2114l\204\246\320D$F\032A\343\311\024Ya*,\201`B\006\237\030\314K\311\362\003\364#D\316\206\255\300D\257\020$\215Q\203H\"\336\340\254\340 \000\211\245D\223\230!\234\260\024\314\004\346\201\261,(\027|b$q\207\247P\004\316'\004\200\357\230F\013\003J\257\336\350\233g\215\246\367\244\325N\227\253\006g\326\326\277u\336\232\326*\373\372E\323\237k\266\363k\275\206\372\354y\330\243\341\252G\265\207\273y\365\333\217\342\271\277\003\237Fk\266\2564\255i\335\357\272\361\375T\232\2469L5\315\373\247\373~\230\003=\235i\246\341\255=\307m\223{k1\367\032[nk\\\236o9\316b\274\351\2778c.\303\225\273\240\236\364\276\347\275\246\251^\306\266y\030\232\rH\077\077\3151\\\266\256.\264\351\222\320\330\216\3104M\323TT\257\303\247\254\336\317e\366h\024\023r]\365\214\214L\014\325\225[\335\377f\376\362\357\357<\327\225\202\336\357\251\320\024\232\274,\274(\331c%\364\230\306\014\"\235\345\234)gHe\010\231C\2640\362R\001\301J\237\322\004\033\001*\271\317NK\264\001uH#\215\224\250\3014\326\020W!\213\234\356u\203\324@\0236x\305\220`;H\031\344j\274!\232R\243\004\321\363\001\321\261Q\243\254q\241\274PR\222L\344g\334>.\242\204\221\030\tf\024\231c\002\361\201I\254%^\020\365\310MN=)OF\250\230@\307Cn#\206\222r\343L\034\017/\326\314\221\301H\023Z\010\027\200\304Z\302\222\321\201+t@\352\321\300\330\022O(\302\222\020\004\311\353\3058`t\020\035P\316\211\r\345\2525\342\370\204\036\321Ehg\216\030\006\224\236\221dL\215)q\222\2431\300\350@|A2N\035\020\214\004&\"\346!]D \211y^-\222\303\204r\302\210\216\315\034G\005vr\2249L\224&@%\310\201\010\211\203\0214R\216\214\026\303N\nU\306\344\240\010\225\241\001\245\310'\026\002\242\343R\301$fiJ\232ZVU\251\372\362""\265RK\225\334\217\036\260\0130\372:\361\"\275@/MN\322\002IB\212Lb8n\2247l\2246*\224\013\306\233p\206\rLb\2361G\330`\244D\301G\200\370\340\243C\"\000c\t\225\255\3614\222\306-R8\205& \261\371J\275>L(M\304\023\020\235\003!1\222\327\315\230\302\240d\220 f\362A\032\t\001\360\000\224#\363ZA\006\202\233\250\202\233\026\204\016\r\211\214\210$I\222\306R\020\010\210\244\201\234I\263=b\211\242\0049\022R\006\031C\024\221\021\221\211DDD\n\n\222\024\n\035\006\302\355\213 j\325\013pi&\331\212\216l(\244}\200fq8\177\340_i\024\322\222\375\305\230\214\341^pm\014\0170\216p\010\344LlW\200\016X-X\200>\350\020\256\243\030Vv\016[\354\024\031\004v\206>\357n9)\337:\036\330\224lq\337\243\363\361[\302[\246\340\372\360>\365\205\210\366\350\371\242M-\310L\323A\253=zk\007\300\206\004\177\232\233JA\022\022~L<\341\027(\330\340C\314\206.\030h\266\376\245\271R\314\010\214E\322\003N\032B\t\313\270Ka//\035G\004\327\3726aX8b\017\363_\361\342\201\334\333?e\327\007\0320Sv\252\024|\0356:}$\251\357\020\363K\000~\257\371y>\233\312\250\355H?\032\201\236\341s\036\241y\306\264\302\263.\203\025J1\330\002m\330.\003\203\34469\321*|\314\037\264\014<\316\355\376\320\341\232%\206\352Zgs\370\262\316d\227\351\010\343\0031\312\246\224W\013\302\212\236E\213\036F\240\0069\341\264M`\"\211\264\202\223\001\330\333^\207\216#\335Q\007\270)\332\340z\022!\347\215e5\275\021\036\005-\232\265\354\333\341\250\362 \177\237\334\025\354\3717\270\374\372\017\365\001\340\200\014\315\212Gs33\365Y\010\010\251\007O {\313\032\007\356\202\"A\003ZMA\302\n.=/W\322\320%\362K\372\271\214\210A\006\324\341\240+#&\262\353b\245\000\371\331\272\245\211\265\022\031\205\017\200\244\022\027~\213\031\021\314@\331\260[\263\356\212PE\216?\364\030\350h\n\223q\\\200<\212\211\317\307\341\335\300\237\235\032\202\207'f%C?\374\022\374}\247eZ\364\006\251\256\300\032\263\373\220\324\315\310[\004\267\024\324\\\260\0326\361\251\034q\201)1\254\323bd\314R\331\240\313 ;4\243\351\223\307\036Z\351\325\355\256\024%\256Z\255K\240\303\0274r,\261D\336F-\221\353\016*)\306""\216\332\204\323\022\0321\320\242\264L8\005\264\200M?Q\204\317}\355\245\226\372\035\032\026\300\246\256\2412\306\340#o\020\252\377~\320\200\026\326\004\376\366\001\351^\243\0071\311\004\252\371/\027Y\346\3108\334\314tq&\t\276B\245b=\201\230d\323l\214\035\"\324\003\323n\333g\231\354\222\342\325z \034\rl\336\205\263\233\0135\244}\032\270\311Ug\344(\312\361E\227\004\370\305\223\220\212\244\250\225\366\361J\022x\036\361\001\204\"}\234/\003\257X\272D\360\"[p\217\231\243\305;\242\332\034J?%\361k\271\203_hX\307L]\246\220\251t\262\235\356R\206\024BTF\351\026\312\336\221\312}7\234\2308\212p\243\\\277,\373\230\3650\321\201/\324\257(\263\216\242\354\247\364\305\377p\301\236\344\214\316\340-\n\215\n\001}\274r\364\370Z]\0146\325\016$d\"\255\201\024\342|j\253\200O\334B\361\022X0\374\002\241\261\006\250\231j~\033T\362\336\270\350KN\321\370\006\177\270\005\203\026I\262\031\201\245\204\316\257b\240\366\240\246\335\355\212E\000\013\320\337*\242fHmr\365\261\306\365x:\376L\221\363\2728/\023\332\265mYa#3M\3431\005\2302\253.5\205\2256\235\227\245-)\252Zh\345\271\364\033\233\311\256\200\332\234\257\231\240\341\232\242\344\367\345A6M\023(\242q\026\322-\250\215#d\327`(\213\246kM\206j\221Z\332\322\226$1\302\036\\\213\tRQF\254\313\204\225\031\356\354\323\221\004_D\022B\340\232%\222q\214\225o\311\204\242\323=\315\332H\332t\347\241}\221\256\335#\210*)\261\021f\202`\344H)z""\340\025&e4h\331\204I)4\205\220\204\354d\262@\221A@'\r\016\020\261\226\225&\207\021\253\r\310\323\\\037\354Q\217w_\014me\346\215\354u\213\026\035M\001\ri\031f\026\360\031\0368\022\271\261\252\273\364\322\366U\225}\350z9H\026p*\306\\;\207GW'\333\335L&\311M\262kB\222.\025S\004\347\n\225#-w\035\326@\301\2200fm\302\003\226\240\225\246(\023\0171\226\272\262\315\003*1\267\354\334\032\226(nX\315\213\316\016zTG\322\361\370\370+\370b\036!\361(5\263\302\362Kn\350\356_X\247\222$uh\315\355\363\342\266\363!\205\305\336\277)\345\317\331\024\337;\016\355.\233\234E\252\030\004\276\013\362)$\210j\312\005\002=#\3677M\257U+\014N\001\035\010\221\020?1\032\000\020\004\350\023\347\251\260j\033bE\003H\001X33\006wM\tu\364\310\230\007y\240\242({mnr_0i\327,\232\233A\365\274\244z\270\360\303\034\274\220v%\314\370\3518l`\316l\016\324\263%j\341\271w\327O\332\355\261#\330\006\226]u\242H1T\204\220jI\005\334\257\217\206T\357@\030\200\303\234NB\243R\317B\274\204\024\362\000\304\324QI\322,\271p\032\241O\032F\231(\214Lt\260R\255a\204ii&\014\\'\277\"D\004f\303@\266*\241\224\232\201\373;t\220\261Xd#3\315o\264\362<\217SQr\374\262\350\244U\354f-\007\243m\366h\263\223x\263E\220\351BP\341\304R\313\236\314\210\321\013[<\312+\211&\243\247\305D,\014\260X\237\277\230\255\030[g\236\224\022\220tq\372\327a;\027\246\317[\226\277\215m\373o\235-=\377\210\223\360o\357\316t\362\356\275mLfQ2\020\314\021\334\3713\334\374\005\212\002 !6(\023R\201-\344\355\367\025\001\027\256\255\276\263\311\250f\341_\007\rD\257'\2479IT\325+(\362T\347\257\267\275\240:\r\360\256\345\341j\020B\210\327%-\344\031`$\272\220V\222\255-\232\023|b\223\247\036\272\322\261\006\3766\3415\221\253\010r$\202\214\305\226NRR\3022\325\237\332\243\231GT\t\t\005\231\312\205\354\274\234\302.\"\2656\216\262\325\0018P\030aL\217\322\205\010\017\202W\204\341\026R\356\364\322\004Cukn\302}6\327`^\364\\\351\2706Wi8F\257\341\214\224\327\262FP\301\203\315\0041h\205\000\332c\033P\322\337\302fk\252\2519\272\301\023\225/\026\370\3143@\346\"\331(1f\35074X\231\205j[\230h\324\233\0016\014m\275M\352\"N\330e\340\373\367_\227\336\332f\0062/\215\376g\016|\222\017\345\242\366pe. 8\22443\271\273\016\374\354-\004f\210\346\252\r\0049\2616jw\260\210\246\367;U\205\021\255\221\034\374e\327\246zy.\2206\222_\325\254%\036\225\330\200\031\357(B\363Nz\235\\\004\344\266\221\263\252\303\003\215\205\341\223x\3066\341\2506\214\207\352\017\004\030\272\231\036\353\2023\310\310Q\361\010\262\312]q\217\344\211d{ax\242\024\220&4\227=\331\303;\023h\021\333\216mW%~Rw\3178{\300\323e\245\365\241\241\334=\235Ou\266\301\230\352\017Kg\200.}\007\023\237\273]gf\020+\006\026\036:=\213\274\316\227\2322\242\263O\2526\355\303\233IE\372P\034\2010k\215\362+\353\027\31140B-i#\022\325\223\206D\027e\345t\316>\317\261\310\316a\344b\324\320{\253$\006\272\270\223\025\004\203S\004\036hF\241\360\322H\020\212#\026.\275#\202<\256\362\270\220\262\035\370\234\203%o+\032\357-Ae\252\307*\236\215J\251\217\025\021!\304VP1\214 \200m\00414\331\n\314\316f5\025\001\261\236[\t\212P4MC\244\010i\227\271\004\026L\230\"\221\002\272\310New\226X\212\261\026&\003\202\023@\300CV\266\322\261\244\022\221\026\302!\"\224\327\230A1\336\024\004#vE\n8\204\322\014\r\236\201\311\2446""\320\301\214LlLc\030\300cI\246\235O\032\030\335\347\233\\W\221\233\332P\230\227\300\305\224$\220\231T\306\206\201\244\306\330\322\353\353\353\274s-FfwJF\375Z\250R\302\323[)\213p\244yWaj\252A\236)IV\352\014,dX\357\344\026\r`m\314\033\"\001\227\211H\003\025\227\022\203\250/\274-\235\326\023$\222\016L_]\344\225w\372\241\217\252\226%\227\035V\274E\347\366\213o\227\341\214\221\376a2\2420h\030\333`\306\230,\317Rj\0308\201zRBF\304\274\22372N\303Ze\263\351[\264X\273\n\353\244\370\242r[,\226\325\232:\331UhxR\310\000WLD\306\207\230\320\246\301\332 \357 i0cLcC\03064\301\241\215\266\301\266Mh\255P\352\023\207h\022\227c\351\037'&3?[Q\222n%$(c\001k\210\245\302\035kZ\320\032\200\220\261\212X\245J\024V*\271\022Q\037\245H3\220\253X\234u\303\331}\033\231BL\2743\230\266\3143\305\315\234\257\273}\363\330V\270\205)H\033\332vF\361\226l\323\031\325\347\3773I\\\022\305\316e\236\t\236\203\n\224\307\342\346\277\021,\251\206\262\014uL\273Y*\271\264\025\252\tK\037G\032\000\211\ncFub\276\331i\354\346wx\340\256\267.\373\312\021\236s\212\252J\311\026\035\312(d\273H\251X\245&Hm\004'\003S\211Q\240\010\223&Fq\210!\023T\220`\005Uc!\017Hdu\2400\242\002\234\013)9\004 GZ\365\312\225\256\264\222}@\356,\213\016A\243I\232\312H\300h\262\002\005(!(iCH\234P;0\020_SF{\214\331\225}\000\200\021\213m\030\030\214m\031`\221\"y8eL\222Y\344_\341K\207\207\305-\306_\355\216TK\200\023\024\022a\334\227waC\274\275@\316a\270^\205\247)%\275\025\275\243\254\2642\211\004\317_}A\235\275\262Y\345\022\032,\341B\274\256e\000\275\202^\177B\257\231m\342\262\213\263\376\004X\205\3233\036\3431\014:\034\023}/\251/;|,\371\344\262K\311B\246]@\232\240\013\0066%\344\014\241\025\t\232\203\304fr$+>\275FD\010\227\214\310\031\2303\34030A\004\214\235`8\375\002:B\260*\245A\203\301\264\200N\362\202\t\000\360\201\272\261\367\205l\222\370\311\300h\\\311\376x\316\232\271\211A\020\214\303C}{0V\006\206'\250\225\340\363\001C\203\013L\317\310\353\323Ak\226\315\310w\006\021}\236\260\315DE&\263\370\202b\267\255\245F\243W\3028\316E\322\217\302\306\023""\263;\353\005L\367%T\316\257\034J\tDJ\330\222\347\004{z5\\JbM\304\202\300\272\273\014\230\222qtx\360\r\323\337\347c\236m\310\302E\030\321\330\240\300\320=\001\033\244!A\201\331\333&\257\341b\337\017\256<\254t\246\275,\013\257[>\367bc\356Aj^O\356N\251UXc\225Xkr\304tR\361yE7`\370\266{\337\205\355Rv[;\260\312\013\2662\235|\0226\226qm\n~GZp\272\271}3\266\355\306^\272\326g\314\342\233\350)\271\013kW\231\362\271B\240\341\021i\016P\217Co\014[\370\233F\026\221IWAq\326bE\245pZQ\024\0171#G-#K\322\204z\346>\017\212A\363\243\3504c\321\034SO\227;m\377#\010\265U]D\232'i\023h\377\213\271\"\234(H$\242\251\372\200"; + PyObject *data = __Pyx_DecompressString(cstring, 3081, 2); + if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) + const char* const bytes = __Pyx_PyBytes_AsString(data); + #if !CYTHON_ASSUME_SAFE_MACROS + if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } + #endif + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (2987 bytes) */ +const char* const cstring = "x\332\335Y\315s\333\306\025\267Z\267\225R*\221,\371\253\211\247K\177\304dL\323\245-\307\262&r\303\310\316\324\255cK\226\352\330\321h\240%\260\224`\201\000\204\005%\323u&9\352\210#\2168\362\310#\217:\372\210#\217\372\023\374'\344\275]\000\004?$\333\231&\351T\023K\213\335}\337\277\367\336\356&_,k\032\241D\265L\356:T7]\342Z\304\335d\304v\254\212\301j\305\017> \321\317\275\027\264f\033l.\231\300\237;w\356\304[\311\226\331\317\307m\330L\314Y\216\006^\254\321\206\360y\315\266\034\300\202\333\265Of|,\346\327\313\367\234\310L\221\347G\344f*\001ryDJ\356?\227\351\3459R\372\276@\344\350\372\367\275\324+N\235\035\225\030\211\245\271M\3127ebV\236Cx z\217\304\2008\014\201\002I\216\250\241\261.\003N\2179\365,h\200!T\323\3209\300\325\255\203\313\n\200\026W \363\220D\274+h\326A\201eDW\225\350.\253\361\001y\200\014\335D\225D\200,@2*\217(\007`\nD\343\302\206\276\303\314\256\225\020\370\001F \264^c=\010\260LD\n\251Y\016K\241\375\177\257\370\277\177\221$\0063s\tY\357\362\355\201\315\022S7\n\344rE\240""\014!\227\020\377,\234\211\232\321-\026}\240\303\232Q6\033\321\327@\244 \241]*\203N{jND\035CU \365m8\345o\007\352o\202\321A.X\255\372@\272\260I\315\r\226\206#\306Et\324\272\343@\256B\317\005s\352\234\275\013L#\322y\362\310v\365\232\376\222i_Qu\013J\247\272\005\312/\213\325\303\221\233B\267d\364\266\372%\270\021\235Gr\337\013G\221\252=M\234\246##\371cd\036\262\335CA\320'y\001i\321[\032&\271\210\032\353\226:q\364q\030\264M\266\303\272\370/\246z\370+h\323Q#~\205\r\266\273\304\347R\035\233\223Z\235\273\262\335K\3759\032\300\353\025\241\275\374\302\240\246X\213\025\2117\364\031\253\331nC~\2763\267\210Zr\002hCSwE{\254\352\340_\300\205-\372q\252a\362\350T\"\317\n\274@6,\227|\255\343\021P\372\242\356\230\230\203\221/~\341\322\330\327\3668y\010\005z\0206\357\\Y\261\250\316\274s\237\355\331%+\342\314\365\357\273&>\026\336\350\303\251\246\213\303\030u\032\220\276\266\2155\240\247\221\310\032\000\345#\366 \234\233\323.L\230\r8\035NA\335\262\377\253\371\035Z\t^\004V\327~%\267\367\267\256\325\304\361ko\361\200\206\016\277\311H\321\003\004&{\341\346\220\352\260&\375\216\004+\220\207\254\002\271Hr5\213\343\225WEl\341\333\007\201\372\340\016y""\300)\026{\037E\226]\313\276/\002\005\352&+\313\361%\345\225\350\037+\320\214De\207\312\304 \303\265\3700\246u\257\250\377\346\361\205\241\277\346\230de\323aT[\264,\003\356\246\032#\273:t\241\272K\252\016c\256XCZ\361\222\243R(_p\347\000\330@u\022\257r\240G\361\031\264\227M\n\rB\034v\007_\260\270\340\331'\032\301\000\207K\256\240\320y\014v>\251U(%zQJ\037\037\261\364\202:x\333cd\323um>w\355\232-\237\242\272\373\212\033 \254^)\352\326\340\3325\361T\210\316+n\2725\343B\212\252\3171\232\245r\270 \241_w7\033\371\002)\376\0350\247@wd)v1\252\354\206\246s\341\351\304\373\370\346Ek\014\321'\017\305u\031FH\260\2728K0\023\t6T\235\313\221\206)\262\n\234\327\304@\\\027\327\326y\324U\2409\200\354\236\356\023\267\027q\317\310\301\006A\262\232\242.\210\003\313jt\363\004\205\327\344o\350%:`\250\030\337/\026\254\232\255\213\321`\360\272#y\342\037\334\361\217\350\276}D\027\352unT%\342\222\254(Xd\025%\371\206\034\305KZ\377w\361\013\303\202\354\341w \211M|i\034\332\300\206N\036E\032\327\221a\035mH\033:\244\263\rkX\303\346\312\374\001\304\347.\204e\330\352#|Id\032n9T\345C\366\017\264\304\236F8\320\376\300\335\215\027\360\0175Q\036B\005{\314\252qa\211v\364x0\345\225\264\203 \252\311\361WQ\242\323#\203\221\215\357\250\2247LU\267\212\252\345\000\350\241\335\362\n\224\031U\005\036\216\212\355\027\"\257\270q\235T\r\213Cr\001NTy\027\246\025U\025\310d\212k)\251J\320\035\246\022x\350zQ\276\301\244&\304S\264\223\236\220\256I\315\310\234\343\303%\302\320n\250V\335t5\306l\374P\024(\026\370\013%\311\337\034\034\n\366\367\224PE\301\327tE\211\302\031\243:\025\316>H\245\003=\034B\207@!\201\000\014\320\303\342}\032\005\273\370\242\244(q\302):\332\030\205\006?6tC\211\212\021\356\004\002PC\274Bm\261\006\304\027MCr(kT\224\035\361aiu\210\220R\343`\242\t%\017~\203\371\226-\017\030B\270\250\205\\\376_\000[W\267D\255\261-\333v0\355D\033P`\014\033\200ZIw\006E\331\256SC\262u\000\237p\031\341\212`\001.\025\320\026\277\226\021v\3626\313\231Q\205\222\252\245\240\016\303H3\030E\257\377\034*\225\202\345Q\014\260h&G""\240\370o2\220\373\222\257h3\262\216\377\270N\032-\034\235\3452\016>\206\360[\273;p+\3245\320P\334\016\345\0251N\033%\311\237\356 \305j\227:&\376\303\027\223\227\272\035\036\277\030\224\337\220cc\231\275\333\336\202\347\372\245N\346Dxb\266=\322\236n/\265)|y\237\371e\177\2513\372\347\275\231\275\227\376\244\177%x\322\274\325\312\267g\332\356\376\255\327\331\327\263\341\362J's\322[\201\265,n\233\363\226\274M\237\312\271\263A6(u\306\247\275\262\367\024\270\300\334\023\277\344\227\017\200o\026\231\347\361K2\337N\t\313\354\375\313\333\3663A\371\307\362\233\351cc\343{w\275\361x~\307_\202\331\277\340,l\202\341'\307\306Nx\347|\253\271\322:\333\316\266\347\366W^\237\t\227\036'\\\247\274Rg\364\243=\327\233\365\347\233#\315\263\255\253\355\367$\373\"\330n\216\265\316\265\351\217\302Yo!\233\001\325G\"\322\360\343+\315R\363~km?\013\264g\216\215M\300l\351\307r\347\303\223\341\311\313\301\313\326dg\354\203\203\321\263\376tx\356fk\251E;\243\323\020\010\301\340\257\276\033\224\202\205`;\314\315\266\377 \302\001BJ\007\2313\376\357\205\3332\037AD\246`0q\312{\036\214t\246Oy\324{\031\234\010/<\r\237>\013\237}\327\231\3167'\233\027\233\264\311[\331V\251\365UKk_j\377\360Z\r\227\224Pa!\253\206U=\324\267\302-\2433}\001\204\335EQ\"\366\007\243c\235\314\270\374/<\236\013s\367\366W\303\305\2457\237\"V0\304F\000\001\234\010'\262\301ip\352$\356\034?-\203\326\311d\303\354\227\341\227\317\303\347\202u\357\2667\177D\026\022L\205\200\242\025/\320\340\203\211s\341\271k\315\355\326Hg\362c\260\357As\244\203S\267\333\223\355\354\001\230H#;\203I\004\3027\376\351\340wA\241I\375\245`)\230\014F\302\343\237\006\364M\016q\361\000\334\227\231\3602\000\246\357\300}\260\260\021^\375j?{0J\202\343\3017\340tp\344\347\336\224w\017\334\267\340o\007\177\nx\023\3149\215\340\352\214\236F'\002lG\247\274y\344\013fuFOx\027\275\255\340$(\014\353\273>\303u\210\230\264\346\306\036\335s\303\251O\203Js\344\000$\177\350k\340\236\211\263\341Ya\020@G\337\177\211(\231\300\350r\377\222\277\335\231>\343\177\030P\024\214\361\357\n[3(\256\022d\232e)\013Rt*\234\272\024^\3726\374\366\351\301\250P.#M>\343\217\370\237\004K\362{\034\006\322\t\310\253\354?\0136\232\217\233\257\332\245xy\025<\2359\005FM\006W\232\317Z\265}\261\362Oo\303\377\026cx\302\273\202\031\033i\203\256y\022\224\016\000\326\rd\215^y\341o\277\311\310<\334\365\3250\373E\033R9\023f\346\332Y\361\027\240/\376^o\t\023'D\310/\372\317\233cai=\\\247!\225\020D\234H\333\020X\232\377\031\212\237\360F\274\310\0313 \351\207\246\326\272\010\3511\201\245d\351'gF\023\273"; + PyObject *data = __Pyx_DecompressString(cstring, 2987, 1); + if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) + const char* const bytes = __Pyx_PyBytes_AsString(data); + #if !CYTHON_ASSUME_SAFE_MACROS + if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } + #endif + #else /* compression: none (8439 bytes) */ +const char* const bytes = ").Add a constraint to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(lambda a, b: b == a+1, [\"a\", \"b\"])\n >>> problem.addConstraint(\"b == a+1 and a+b >= 2\") # experimental string format, automatically parsed, preferable over callables\n >>> solutions = problem.getSolutions()\n >>>\n\n Args:\n constraint (instance of :py:class:`Constraint`, function to be wrapped by :py:class:`FunctionConstraint`, or string expression):\n Constraint to be included in the problem. Can be either a Constraint, a callable (function or lambda), or Python-evaluable string expression that will be parsed automatically.\n variables (set or sequence of variables): :py:class:`Variables` affected\n by the constraint (default to all variables). Depending\n on the constraint type the order may be important.\n Add a variable to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariable(\"a\", [1, 2])\n >>> problem.getSolution() in ({'a': 1}, {'a': 2})\n True\n\n Args:\n variable (hashable object): Object representing a problem\n variable\n domain (list, tuple, set, or instance of :py:class:`Domain`): Set of items\n defining the possible values that the given variable may\n assume\n Add one or more variables to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> solutions = problem.getSolutions()\n >>> len(solutions)\n 9\n >>> {'a': 3, 'b': 1} in solutions\n True\n\n Args:\n variables (sequence of hashable objects): Any object\n cont""aining a sequence of objects represeting problem\n variables\n domain (list, tuple, or instance of :py:class:`Domain`): Set of items\n defining the possible values that the given variables\n may assume\n Change the problem solver currently in use.\n\n Example:\n >>> solver = OptimizedBacktrackingSolver()\n >>> problem = Problem(solver)\n >>> problem.getSolver() is solver\n True\n\n Args:\n solver (instance of a :py:class:`Solver`): New problem\n solver\n Class used to define a problem and retrieve solutions.Constraint | Callable | strConstraints: Constraints must be instances of subclasses of the Constraint classDomain is emptyDomains must be instances of subclasses of the Domain classDuplicate configs: Expected constraints to be strings, got Find and return a solution to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.getSolution() is None\n True\n >>> problem.addVariables([\"a\"], [42])\n >>> problem.getSolution()\n {'a': 42}\n\n Returns:\n dictionary mapping variables to values: Solution for the problem\n Find and return all solutions to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.getSolutions() == []\n True\n >>> problem.addVariables([\"a\"], [42])\n >>> problem.getSolutions()\n [{'a': 42}]\n\n Returns:\n list of dictionaries mapping variables to values: All solutions for the problem\n NoneNote that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.Obtain the problem solver currently in use.\n\n Example:\n >>> solver = OptimizedBacktrackingSolve""r()\n >>> problem = Problem(solver)\n >>> problem.getSolver() is solver\n True\n\n Returns:\n instance of a :py:class:`Solver` subclass: Solver currently in use\n ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.Problem.addConstraint (line 140)Problem.addVariable (line 85)Problem.addVariables (line 117)Problem.getSolutionIter (line 217)Problem.getSolution (line 179)Problem.getSolutions (line 198)Problem.getSolver (line 71)Problem.reset (line 43)Problem.setSolver (line 56)Reset the current problem definition.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariable(\"a\", [1, 2])\n >>> problem.reset()\n >>> problem.getSolution()\n >>>\n Return an iterator to the solutions of the problem.\n\n Example:\n >>> problem = Problem()\n >>> list(problem.getSolutionIter()) == []\n True\n >>> problem.addVariables([\"a\"], [42])\n >>> iter = problem.getSolutionIter()\n >>> next(iter)\n {'a': 42}\n >>> next(iter)\n Traceback (most recent call last):\n ...\n StopIteration\n Sequence | NoneTried to insert duplicated variable Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why), .?add_noteconstraint/problem.pydisable duplicate parameter configurations out of enablegcisenabledlist[str]list[tuple]`solver` is not instance of Solver class (is tuple[list[tuple], dict[tuple, int], int] unique.CallableCompilableFunctionConstraintConstraintDomainFunctionConstraintHashableOptimizedB""acktrackingSolverParallelSolverProblemProblem.__init__Problem._getArgsProblem._getArgs..genexprProblem.addConstraintProblem.addConstraint..genexprProblem.addVariableProblem.addVariablesProblem.getSolutionProblem.getSolutionIterProblem.getSolutionsProblem.getSolutionsAsListDictProblem.getSolutionsOrderedList..genexprProblem.getSolutionsOrderedListProblem.getSolverProblem.resetProblem.setSolver__Pyx_PyDict_NextRefSequenceSolver_addConstraintaddVariableaddVariablesallvariables__annotate__appendasyncio.coroutinesboolcclearcline_in_tracebackclosecollections.abccompile_to_constraintsconstraintconstraint.constraintsconstraint.domainconstraint.parserconstraint.problemconstraint.solvers_constraintsconstraintscopycountdeepcopy__doc__domaindomainsextendfreethreading__func__genexpr_getArgsgetSolutiongetSolutionItergetSolutionsgetSolutionsAsListDictgetSolutionsOrderedListgetSolverget_in_order__getitem____init___is_coroutine_is_gil_enableditemgetteritemskeys__main____metaclass____module__msg__name__nextoperatororderparamsparsedpicklablepoppreProcess__prepare___process_mode__qualname__requires_picklingresetresetStatereturnselfsendsetSolver__set_name__setdefaultsize_dictsize_listsolutionsolutionssolutions_dictsolutions_listsolver_solver_str_constraintssys__test__throwvvalidatevaluevaluesvariable_variablesvariablesvconstraintswarnwarningszip\320\004$\240A\360 \000\t\014\2109\220C\220t\2301\330\014\022\320\0228\270\001\270\024\270Q\270a\330\014\022\220*\230A\230Q\330\010\013\2104\210z\230\021\230+\240V\2507\260)\2704\270t\3007\310!\3108\320ST\330\014\025\220T\230\021\230!\330\010\013\210:\220Q\220h\230a\330\014\025\220T\230\031\240!\2401\330\r\024\220A\220X\230Q\330\014\025\220V\2301\230A\340\014\022\220!\330\014\022\220)\2301\230A\330\010\013\2104\210q\330\014\022\220*\230A\230Q\330\010\014\210K\220q\230\014\240A\200A\360\024\000\t\r\210D\220\r\230Q\330\010\014\210K\220v\230Q\200A\360\032\000\t\r\210K\220q\200A\360\034\000\t\022\220\035\230o\250T\260\031\270!""\270:\300T\310\030\320QR\330\010\013\2104\210q\330\014\023\2201\330\010\017\210t\2208\230=\250\001\250\031\260-\270q\200A\360\034\000\t\022\220\035\230o\250T\260\031\270!\270:\300T\310\030\320QR\330\010\013\2104\210q\330\014\023\2201\330\010\017\210t\2208\230<\240q\250\t\260\035\270a\200A\360 \000\t\022\220\035\230o\250T\260\031\270!\270:\300T\310\030\320QR\330\010\013\2104\210q\330\014\023\2204\220q\230\001\330\010\017\210t\2208\320\033+\2501\250I\260]\300!\200A\360\030\000\t\020\210t\2201\200A\330\016\025\320\025'\240z\260\021\330\t\n\340\010\031\230\024\320\0355\260Q\260a\330\010\024\220C\220q\230\001\330\010\037\230t\2401\240C\240q\320(8\270\005\270Q\270a\330\010\013\2101\340\014\030\230\003\2301\230A\330\014\017\210z\230\023\230A\330\020\026\220j\240\001\330\024\026\220a\220z\240\022\320#X\320XY\320YZ\330\024)\250\021\250$\250a\250s\260!\2601\260B\260d\270%\270\177\310c\320Q_\320_e\320ef\320fi\320ik\320kl\330\024#\2401\240D\320(8\270\001\270\024\270Q\340\010\t\330\014\r\330\014\r\330\014\r\320\004(\320(E\300[\320PQ\360&\000\t\014\210:\220Q\220l\240!\330\014\020\320\020!\240\027\250\001\250\021\330\014\r\330\r\027\220q\230\014\240A\330\014!\320!@\320@j\320jk\320kl\330\014\020\320\020!\240\027\250\001\250\021\330\014\r\360\006\000\t\014\2104\210z\230\021\230,\240a\330\014\017\210x\220q\230\001\340\020\035\320\035/\250q\260\001\330\021\033\2301\230L\250\001\330\020\035\320\0359\270\021\270!\340\020\026\220a\330\020\026\220j\240\001\240\021\330\010\014\210M\230\027\240\002\240,\250a\230Q\240Q\240\021\240\001\320\004&\240a\360(\000\t\r\210L\230\001\330\014\020\220\014\230A\230Z\240q\320\004&\240g\320-B\300!\340\010 \240\004\240M\260\021\330\010\013\2106\220\023\220E\230\023\230C\230q\240\007\240s\250!\330\014\027\220v\230Q\330\010\027\220z\240\022\2401\330\010\023\220=\240\001\320\004\027\220q\330\010\022\220$\220k\240\025\240a\330\010\027\220w\230e\2401\330\0105\260Q\360\006\000\t\014\2103\210a\210t\320\023&\240b\250\001\340\014\020\220\016\230d\240!\330\020\031""\320\031/\250q\260\001\260\035\270i\300z\320QR\330\020\024\220C\220s\230%\230q\330\024\030\230\016\240a\240s\250!\360\006\000\t\r\210L\230\r\240T\250\021\330\014\017\210t\2201\330\020\034\230D\240\001\240\021\330\014\027\220w\230b\240\014\250A\360\006\000\t\014\2101\330\014\023\320\023%\320%W\320WX\340\010\027\220q\330\010\014\210L\230\001\330\014\030\230\001\230\034\240Q\330\010\014\210L\230\r\240Q\330\014\020\220\014\230A\330\020\034\230A\230Y\240g\250R\250|\2701\330\010\014\210L\230\r\240[\260\001\330\014\026\220k\240\021\240+\250Y\260m\3001\330\010\014\210J\220g\230W\240A\330\014\022\220+\230Q\330\014\017\210t\2201\330\020\027\220v\230V\2401\340\010\017\210y\230\r\240Q\320\004\027\220x\230q\360\014\000\t\r\210K\220w\230c\320!<\270A\330\010\014\320\014:\270!\330\010\014\320\014+\2501\330\010\014\320\0142\260!\360\006\000\t\020\210z\230\021\230$\230j\250\t\3201`\320`a\320ae\320ef\320fj\320jk\360\006\000\t\014\210:\220Q\220d\230*\240A\330\014\020\220\001\220\021\330\014\017\210t\2204\220x\230\177\250d\260$\260a\330\020\024\220A\220Q"; + PyObject *data = NULL; + CYTHON_UNUSED_VAR(__Pyx_DecompressString); + #endif + PyObject **stringtab = __pyx_mstate->__pyx_string_tab; + Py_ssize_t pos = 0; + for (int i = 0; i < 173; i++) { + Py_ssize_t bytes_length = index[i].length; + PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL); + if (likely(string) && i >= 49) PyUnicode_InternInPlace(&string); + if (unlikely(!string)) { + Py_XDECREF(data); + __PYX_ERR(0, 1, __pyx_L1_error) + } + stringtab[i] = string; + pos += bytes_length; + } + for (int i = 173; i < 190; i++) { + Py_ssize_t bytes_length = index[i].length; + PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); + stringtab[i] = string; + pos += bytes_length; + if (unlikely(!string)) { + Py_XDECREF(data); + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + Py_XDECREF(data); + for (Py_ssize_t i = 0; i < 190; i++) { + if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = stringtab + 173; + for (Py_ssize_t i=0; i<17; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif + } + { + PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0; + int8_t const cint_constants_1[] = {1}; + for (int i = 0; i < 1; i++) { + numbertab[i] = PyLong_FromLong(cint_constants_1[i - 0]); + if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_number_tab; + for (Py_ssize_t i=0; i<1; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_codeobjects ### */ -\ - typedef struct { - unsigned int argcount : 2; - unsigned int num_posonly_args : 1; - unsigned int num_kwonly_args : 1; - unsigned int nlocals : 5; - unsigned int flags : 10; - unsigned int first_line : 9; - unsigned int line_table_length : 13; - } __Pyx_PyCode_New_function_description; +typedef struct { + unsigned int argcount : 2; + unsigned int num_posonly_args : 1; + unsigned int num_kwonly_args : 1; + unsigned int nlocals : 5; + unsigned int flags : 10; + unsigned int first_line : 9; +} __Pyx_PyCode_New_function_description; /* NewCodeObj.proto */ static PyObject* __Pyx_PyCode_New( const __Pyx_PyCode_New_function_description descr, PyObject * const *varnames, PyObject *filename, PyObject *funcname, - const char *line_table, + PyObject *line_table, PyObject *tuple_dedup_map ); @@ -10837,89 +10949,89 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { PyObject* tuple_dedup_map = PyDict_New(); if (unlikely(!tuple_dedup_map)) return -1; { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 162, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 163}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c}; - __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 241, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 242}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_solution}; - __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 243, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 244}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_params}; - __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 286, 2}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u__6}; - __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 289}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u__7}; + __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 24, 125}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 23}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_solver}; - __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_xq_Kwc_A_1_2_z_j_3ddhhiimmn_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_xq_Kwc_A_1_2_z_j_1_aaeeffjjk_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 44, 22}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 43}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; - __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_reset, __pyx_k_A_D_Q_KvQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_A_D_Q_KvQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 57, 11}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 56}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_solver}; - __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_setSolver, __pyx_k_A_Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_setSolver, __pyx_mstate->__pyx_kp_b_iso88591_A_Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 72, 11}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 71}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; - __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolver, __pyx_k_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolver, __pyx_mstate->__pyx_kp_b_iso88591_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 86, 122}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 85}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_msg}; - __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_addVariable, __pyx_k_A_9Ct1_D_AQ_Qha_T_1_AXQ_V1A_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_addVariable, __pyx_mstate->__pyx_kp_b_iso88591_A_9Ct1_8_Qa_AQ_4z_V7_4t7_8ST_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 116, 25}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 117}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables_2, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_variable}; - __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_addVariables, __pyx_k_a_L_AZq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_addVariables, __pyx_mstate->__pyx_kp_b_iso88591_a_L_AZq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 139, 157}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 140}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables_2, __pyx_mstate->__pyx_n_u_msg, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_addConstraint, __pyx_k_J_UV_Ql_q_A_Bnno_4z_a_xq_q_1L_9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_addConstraint, __pyx_mstate->__pyx_kp_b_iso88591_E_PQ_Ql_q_A_jjkkl_4z_a_xq_q_1L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 178, 55}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 179}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints_2, __pyx_mstate->__pyx_n_u_vconstraints}; - __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_A_oT_T_QR_4q_1_t8_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_mstate->__pyx_kp_b_iso88591_A_oT_T_QR_4q_1_t8_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 197, 55}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 198}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints_2, __pyx_mstate->__pyx_n_u_vconstraints}; - __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_k_A_oT_T_QR_4q_1_t8_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_mstate->__pyx_kp_b_iso88591_A_oT_T_QR_4q_1_t8_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 216, 60}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 217}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints_2, __pyx_mstate->__pyx_n_u_vconstraints}; - __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolutionIter, __pyx_k_A_oT_T_QR_4q_4q_t8_1I, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolutionIter, __pyx_mstate->__pyx_kp_b_iso88591_A_oT_T_QR_4q_4q_t8_1I, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 237, 63}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 238}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_order, __pyx_mstate->__pyx_n_u_solutions, __pyx_mstate->__pyx_n_u_get_in_order, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolutionsOrderedList, __pyx_k_g_B_M_6_E_Cq_s_vQ_z_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolutionsOrderedList, __pyx_mstate->__pyx_kp_b_iso88591_g_B_M_6_E_Cq_s_vQ_z_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 245, 109}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_order, __pyx_mstate->__pyx_n_u_validate, __pyx_mstate->__pyx_n_u_solutions_list, __pyx_mstate->__pyx_n_u_size_list, __pyx_mstate->__pyx_n_u_solutions_dict, __pyx_mstate->__pyx_n_u_size_dict}; - __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolutionsAsListDict, __pyx_k_A_z_5Qa_Cq_t1Cq_8_Qa_1_1A_z_A_j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 246}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_order, __pyx_mstate->__pyx_n_u_validate, __pyx_mstate->__pyx_n_u_solutions_list, __pyx_mstate->__pyx_n_u_size_list, __pyx_mstate->__pyx_n_u_solutions_dict, __pyx_mstate->__pyx_n_u_size_dict, __pyx_mstate->__pyx_n_u_c}; + __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolutionsAsListDict, __pyx_mstate->__pyx_kp_b_iso88591_A_z_5Qa_Cq_t1Cq_8_Qa_1_1A_z_A_j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 265, 278}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_picklable, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_allvariables, __pyx_mstate->__pyx_n_u_constraints_2, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_parsed, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u__6, __pyx_mstate->__pyx_n_u_variables_2, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getArgs, __pyx_k_q_k_a_we1_5Q_3at_b_d_q_izQR_Cs, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 268}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_picklable, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_allvariables, __pyx_mstate->__pyx_n_u_constraints_2, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_parsed, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u__7, __pyx_mstate->__pyx_n_u_variables_2, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getArgs, __pyx_mstate->__pyx_kp_b_iso88591_q_k_a_we1_5Q_3at_b_d_q_izQR_Cs, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; @@ -10932,27 +11044,42 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitGlobals(void) { /* PythonCompatibility.init */ if (likely(__Pyx_init_co_variables() == 0)); else - -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* AssertionsEnabled.init */ if (likely(__Pyx_init_assertions_enabled() == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + /* CommonTypesMetaclass.init */ + if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* CachedMethodType.init */ #if CYTHON_COMPILING_IN_LIMITED_API -{ - PyObject *typesModule=NULL; - typesModule = PyImport_ImportModule("types"); - if (typesModule) { - __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - } -} // error handling follows -#endif + { + PyObject *typesModule=NULL; + typesModule = PyImport_ImportModule("types"); + if (typesModule) { + __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + } + } // error handling follows + #endif + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + /* CythonFunctionShared.init */ + if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + /* Generator.init */ + if (likely(__pyx_Generator_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -10993,7 +11120,7 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { } #endif -/* PyErrExceptionMatches */ +/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; @@ -11034,7 +11161,7 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta } #endif -/* PyErrFetchRestore */ +/* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 @@ -11093,7 +11220,7 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject } #endif -/* PyObjectGetAttrStr */ +/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); @@ -11103,7 +11230,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject } #endif -/* PyObjectGetAttrStrNoError */ +/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare @@ -11142,7 +11269,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { return result; } -/* TupleAndListFromArray */ +/* TupleAndListFromArray (used by fastcall) */ #if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) @@ -11155,11 +11282,11 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; for (i = 0; i < n; i++) { - if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { + Py_INCREF(src[i]); + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) { Py_DECREF(res); return NULL; } - Py_INCREF(src[i]); } return res; } @@ -11198,7 +11325,7 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) } #endif -/* BytesEquals */ +/* BytesEquals (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) @@ -11246,7 +11373,7 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq #endif } -/* UnicodeEquals */ +/* UnicodeEquals (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); @@ -11381,120 +11508,7 @@ CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, Py #endif #endif -/* RaiseDoubleKeywords */ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); -} - -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; - PyObject *kwdefs; - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { - return NULL; - } - if ( - co->co_kwonlyargcount == 0 && - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); - kwdefs = PyFunction_GET_KW_DEFAULTS(func); - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif - -/* PyObjectCall */ +/* PyObjectCall (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; @@ -11514,7 +11528,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg } #endif -/* PyObjectCallMethO */ +/* PyObjectCallMethO (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; @@ -11534,7 +11548,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject } #endif -/* PyObjectFastCall */ +/* PyObjectFastCall (used by PyObjectCallOneArg) */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; @@ -11558,7 +11572,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * con #elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { PyTypeObject *tp = Py_TYPE(callable); - #if defined(__Pyx_CyFunction_USED) + #if defined(__Pyx_CyFunction_USED) && CYTHON_METH_FASTCALL if (__Pyx_CyFunction_CheckExact(callable)) { return __Pyx_CyFunction_func_vectorcall(callable); } @@ -11589,38 +11603,16 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return __Pyx_PyObject_CallMethO(func, args[0]); } #endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); - } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); - } - } - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); - } - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); - } - #endif - #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API - vectorcallfunc f = __Pyx_PyVectorcall_Function(func); - if (f) { - return f(func, args, _nargs, NULL); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, _nargs, NULL); - } - #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL - return PyObject_Vectorcall(func, args, _nargs, NULL); + #if CYTHON_VECTORCALL + #if CYTHON_COMPILING_IN_LIMITED_API + return PyObject_Vectorcall(func, args, _nargs, NULL); + #else + vectorcallfunc f = __Pyx_PyVectorcall_Function(func); + if (f) { + return f(func, args, _nargs, NULL); + } + #endif #endif } if (nargs == 0) { @@ -11633,7 +11625,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } -/* UnpackUnboundCMethod */ +/* PyObjectCallOneArg (used by CallUnboundCMethod0) */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *result; @@ -11718,6 +11716,121 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { return 0; } +/* CallUnboundCMethod0 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + if (likely(cfunc->flag == METH_NOARGS)) + return __Pyx_CallCFunction(cfunc, self, NULL); + if (likely(cfunc->flag == METH_FASTCALL)) + return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0); + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL); + if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS))) + return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (cfunc->flag == METH_VARARGS) + return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple); + return __Pyx__CallUnboundCMethod0(cfunc, self); + } +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + else if (unlikely(was_initialized == 1)) { + __Pyx_CachedCFunction tmp_cfunc = { +#ifndef __cplusplus + 0 +#endif + }; + tmp_cfunc.type = cfunc->type; + tmp_cfunc.method_name = cfunc->method_name; + return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self); + } +#endif + PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} +#endif +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *result; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; + result = __Pyx_PyObject_CallOneArg(cfunc->method, self); + return result; +} + +/* py_dict_items (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d); +} + +/* py_dict_values (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d); +} + +/* OwnedDictNext (used by ParseKeywordsImpl) */ +#if CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) { + PyObject *next = NULL; + if (!*ppos) { + if (pvalue) { + PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p); + if (unlikely(!dictview)) goto bad; + *ppos = PyObject_GetIter(dictview); + Py_DECREF(dictview); + } else { + *ppos = PyObject_GetIter(p); + } + if (unlikely(!*ppos)) goto bad; + } + next = PyIter_Next(*ppos); + if (!next) { + if (PyErr_Occurred()) goto bad; + return 0; + } + if (pkey && pvalue) { + *pkey = __Pyx_PySequence_ITEM(next, 0); + if (unlikely(*pkey)) goto bad; + *pvalue = __Pyx_PySequence_ITEM(next, 1); + if (unlikely(*pvalue)) goto bad; + Py_DECREF(next); + } else if (pkey) { + *pkey = next; + } else { + assert(pvalue); + *pvalue = next; + } + return 1; + bad: + Py_XDECREF(next); +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 + PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef"); +#else + PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef); +#endif + if (pkey) *pkey = NULL; + if (pvalue) *pvalue = NULL; + return 0; +} +#else // !CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) { + int result = PyDict_Next(p, ppos, pkey, pvalue); + if (likely(result == 1)) { + if (pkey) Py_INCREF(*pkey); + if (pvalue) Py_INCREF(*pvalue); + } + return result; +} +#endif + +/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); +} + /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { @@ -11772,7 +11885,7 @@ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObje } } -/* ParseKeywords */ +/* ParseKeywordsImpl (used by ParseKeywords) */ static int __Pyx_ValidateDuplicatePosArgs( PyObject *kwds, PyObject ** const argnames[], @@ -11928,16 +12041,23 @@ static void __Pyx_RejectUnknownKeyword( PyObject ** const *first_kw_arg, const char *function_name) { + #if CYTHON_AVOID_BORROWED_REFS + PyObject *pos = NULL; + #else Py_ssize_t pos = 0; + #endif PyObject *key = NULL; __Pyx_BEGIN_CRITICAL_SECTION(kwds); - while (PyDict_Next(kwds, &pos, &key, NULL)) { + while ( + #if CYTHON_AVOID_BORROWED_REFS + __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL) + #else + PyDict_Next(kwds, &pos, &key, NULL) + #endif + ) { PyObject** const *name = first_kw_arg; while (*name && (**name != key)) name++; if (!*name) { - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); - #endif size_t index_found = 0; int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); if (cmp != 1) { @@ -11951,12 +12071,15 @@ static void __Pyx_RejectUnknownKeyword( #endif break; } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(key); - #endif } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif } __Pyx_END_CRITICAL_SECTION(); + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(pos); + #endif assert(PyErr_Occurred()); } static int __Pyx_ParseKeywordDict( @@ -12128,6 +12251,8 @@ static int __Pyx_ParseKeywordsTuple( #endif return -1; } + +/* ParseKeywords */ static int __Pyx_ParseKeywords( PyObject *kwds, PyObject * const *kwvalues, @@ -12173,7 +12298,7 @@ static void __Pyx_RaiseArgtupleInvalid( (num_expected == 1) ? "" : "s", num_found); } -/* PyDictVersioning */ +/* PyDictVersioning (used by GetModuleGlobalName) */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; @@ -12313,8 +12438,8 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, CYTHON_UNUSED_VAR(max_char); CYTHON_UNUSED_VAR(result_ulength); for (i=0; i__pyx_empty_unicode, value_tuple); bad: @@ -12538,7 +12663,7 @@ static void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } -/* GetException */ +/* GetException (used by pep479) */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else @@ -12559,12 +12684,12 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif -#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000 +#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000 local_value = PyErr_GetRaisedException(); #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif -#if __PYX_LIMITED_VERSION_HEX > 0x030C0000 +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); @@ -12582,7 +12707,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } -#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000 +#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000 Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); @@ -12629,7 +12754,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; -#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000 +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 bad: *type = 0; *value = 0; @@ -12669,21 +12794,17 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { } PyException_SetCause(new_exc, val); // steals ref to val PyErr_SetObject(PyExc_RuntimeError, new_exc); + Py_DECREF(new_exc); } -/* PyObjectCall2Args */ +/* PyObjectCall2Args (used by PyObjectCallMethod1) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* PyObjectGetMethod */ +/* PyObjectGetMethod (used by PyObjectCallMethod1) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP @@ -12772,9 +12893,10 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me *method = attr; return 0; } +#endif -/* PyObjectCallMethod1 */ -#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) +/* PyObjectCallMethod1 (used by append) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); @@ -12782,9 +12904,8 @@ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { -#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 +#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) PyObject *args[2] = {obj, arg}; - (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); @@ -12814,12 +12935,12 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { return 0; } -/* PyObjectVectorCallKwBuilder */ +/* PyObjectVectorCallKwBuilder (used by PyObjectVectorCallMethodKwBuilder) */ #if CYTHON_VECTORCALL static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { (void)__Pyx_PyObject_FastCallDict; - if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; Py_INCREF(key); + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; args[n] = value; return 0; } @@ -12897,7 +13018,7 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { return __Pyx_IterFinish(); } -/* ArgTypeTest */ +/* ArgTypeTestFunc (used by ArgTypeTest) */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; @@ -12961,70 +13082,6 @@ __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) return 0; } -/* UnicodeConcatInPlace */ -# if CYTHON_COMPILING_IN_CPYTHON -static int -__Pyx_unicode_modifiable(PyObject *unicode) -{ - if (Py_REFCNT(unicode) != 1) - return 0; - if (!PyUnicode_CheckExact(unicode)) - return 0; - if (PyUnicode_CHECK_INTERNED(unicode)) - return 0; - return 1; -} -static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right - #if CYTHON_REFNANNY - , void* __pyx_refnanny - #endif - ) { - PyObject *left = *p_left; - Py_ssize_t left_len, right_len, new_len; - if (unlikely(__Pyx_PyUnicode_READY(left) == -1)) - return NULL; - if (unlikely(__Pyx_PyUnicode_READY(right) == -1)) - return NULL; - left_len = PyUnicode_GET_LENGTH(left); - if (left_len == 0) { - Py_INCREF(right); - return right; - } - right_len = PyUnicode_GET_LENGTH(right); - if (right_len == 0) { - Py_INCREF(left); - return left; - } - if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) { - PyErr_SetString(PyExc_OverflowError, - "strings are too large to concat"); - return NULL; - } - new_len = left_len + right_len; - if (__Pyx_unicode_modifiable(left) - && PyUnicode_CheckExact(right) - && PyUnicode_KIND(right) <= PyUnicode_KIND(left) - && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) { - int ret; - __Pyx_GIVEREF(*p_left); - ret = PyUnicode_Resize(p_left, new_len); - __Pyx_GOTREF(*p_left); - if (unlikely(ret != 0)) - return NULL; - #if PY_VERSION_HEX >= 0x030d0000 - if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL; - #else - _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len); - #endif - __Pyx_INCREF(*p_left); - __Pyx_GIVEREF(*p_left); - return *p_left; - } else { - return __Pyx_PyUnicode_Concat(left, right); - } - } -#endif - /* DictGetItem */ #if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { @@ -13086,14 +13143,20 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( } #endif // CYTHON_COMPILING_IN_CPYTHON -/* PyObjectCallNoArg */ +/* PyObjectCallNoArg (used by PyObjectCallMethod0) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } -/* PyObjectCallMethod0 */ +/* PyObjectCallMethod0 (used by dict_iter) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { +#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) + PyObject *args[1] = {obj}; + (void) __Pyx_PyObject_CallOneArg; + (void) __Pyx_PyObject_CallNoArg; + return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#else PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { @@ -13106,14 +13169,15 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name Py_DECREF(method); bad: return result; +#endif } -/* RaiseNoneIterError */ +/* RaiseNoneIterError (used by UnpackTupleError) */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } -/* UnpackTupleError */ +/* UnpackTupleError (used by UnpackTuple2) */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); @@ -13130,7 +13194,7 @@ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { } } -/* UnpackTuple2 */ +/* UnpackTuple2 (used by dict_iter) */ static CYTHON_INLINE int __Pyx_unpack_tuple2( PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) { if (likely(is_tuple || PyTuple_Check(tuple))) { @@ -13202,7 +13266,7 @@ static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyOb } /* dict_iter */ -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_AVOID_BORROWED_REFS #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, @@ -13210,7 +13274,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; @@ -13239,7 +13303,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif @@ -13249,7 +13313,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di } return PyObject_GetIter(iterable); } -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem) { @@ -13300,7 +13364,7 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS if (source_is_dict) { int result; #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API @@ -13334,17 +13398,8 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( #endif if (unlikely(pos >= list_size)) return 0; *ppos = pos + 1; - #if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - next_item = PyList_GetItemRef(iter_obj, pos); - if (unlikely(!next_item)) return -1; - #elif CYTHON_ASSUME_SAFE_MACROS - next_item = PyList_GET_ITEM(iter_obj, pos); - Py_INCREF(next_item); - #else - next_item = PyList_GetItem(iter_obj, pos); + next_item = __Pyx_PyList_GET_ITEM_REF(iter_obj, pos, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!next_item)) return -1; - Py_INCREF(next_item); - #endif } else #endif { @@ -13366,6 +13421,28 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( return 1; } +/* AllocateExtensionType */ +static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) { + if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc); + return alloc_func(t, 0); + } else { + newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc); + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (!tp_new) { + PyObject *new_str = PyUnicode_FromString("__new__"); + if (likely(new_str)) { + PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL); + Py_DECREF(new_str); + return o; + } else + return NULL; + } else + #endif + return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0); + } +} + /* CallTypeTraverse */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else @@ -13385,7 +13462,7 @@ static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visi } #endif -/* LimitedApiGetTypeDict */ +/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static Py_ssize_t __Pyx_GetTypeDictOffset(void) { PyObject *tp_dictoffset_o; @@ -13421,7 +13498,7 @@ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { } #endif -/* SetItemOnTypeDict */ +/* SetItemOnTypeDict (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { int result; PyObject *tp_dict; @@ -13478,14 +13555,11 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); -#if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; -#else - type->tp_print = (printfunc) memb->offset; -#endif changed = 1; } #endif // CYTHON_METH_FASTCALL +#if !CYTHON_COMPILING_IN_PYPY else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); @@ -13500,11 +13574,13 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject } changed = 1; } +#endif // !CYTHON_COMPILING_IN_PYPY } memb++; } } #endif // !CYTHON_COMPILING_IN_LIMITED_API +#if !CYTHON_COMPILING_IN_PYPY slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_getset) slot++; @@ -13536,13 +13612,16 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject ++getset; } } +#else + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); +#endif // !CYTHON_COMPILING_IN_PYPY if (changed) PyType_Modified(type); #endif // PY_VERSION_HEX > 0x030900B1 return 0; } -/* ValidateBasesTuple */ +/* ValidateBasesTuple (used by PyType_Ready) */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; @@ -13712,19 +13791,102 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #endif } -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { +/* ImportImpl (used by Import) */ +static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) { + PyObject *imported_module = PyImport_GetModule(qualname); + if (unlikely(!imported_module)) { + *module = NULL; + if (PyErr_Occurred()) { + return -1; + } + return 0; + } + *module = imported_module; + return 1; +} +static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) { + PyObject *imported_module; + PyObject *top_level_package_name; + Py_ssize_t i; + int status, module_found; + Py_ssize_t dot_index; + module_found = __Pyx__Import_GetModule(qualname, &imported_module); + if (unlikely(!module_found || module_found == -1)) { + *module = NULL; + return module_found; + } + if (imported_names) { + for (i = 0; i < len_imported_names; i++) { + PyObject *imported_name = imported_names[i]; +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 + int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name); +#else + int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name); + if (unlikely(has_imported_attribute == -1)) goto error; +#endif + if (!has_imported_attribute) { + goto not_found; + } + } + *module = imported_module; + return 1; + } + dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1); + if (dot_index == -1) { + *module = imported_module; + return 1; + } + if (unlikely(dot_index == -2)) goto error; + top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index); + if (unlikely(!top_level_package_name)) goto error; + Py_DECREF(imported_module); + status = __Pyx__Import_GetModule(top_level_package_name, module); + Py_DECREF(top_level_package_name); + return status; +error: + Py_DECREF(imported_module); + *module = NULL; + return -1; +not_found: + Py_DECREF(imported_module); + *module = NULL; + return 0; +} +static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) { PyObject *module = 0; PyObject *empty_dict = 0; - PyObject *empty_list = 0; + PyObject *from_list = 0; + int module_found; + if (!qualname) { + qualname = name; + } + module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module); + if (likely(module_found == 1)) { + return module; + } else if (unlikely(module_found == -1)) { + return NULL; + } empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; + if (imported_names) { +#if CYTHON_COMPILING_IN_CPYTHON + from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names); + if (unlikely(!from_list)) + goto bad; +#else + from_list = PyList_New(len_imported_names); + if (unlikely(!from_list)) goto bad; + for (Py_ssize_t i=0; i__pyx_d, empty_dict, from_list, 1); + name, moddict, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; @@ -13735,145 +13897,17 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { } if (!module) { module = PyImport_ImportModuleLevelObject( - name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); + name, moddict, empty_dict, from_list, level); } bad: + Py_XDECREF(from_list); Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); - return module; -} - -/* ImportDottedModule */ -static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { - PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; - Py_ssize_t size; - if (unlikely(PyErr_Occurred())) { - PyErr_Clear(); - } -#if CYTHON_ASSUME_SAFE_SIZE - size = PyTuple_GET_SIZE(parts_tuple); -#else - size = PyTuple_Size(parts_tuple); - if (size < 0) goto bad; -#endif - if (likely(size == count)) { - partial_name = name; - } else { - slice = PySequence_GetSlice(parts_tuple, 0, count); - if (unlikely(!slice)) - goto bad; - sep = PyUnicode_FromStringAndSize(".", 1); - if (unlikely(!sep)) - goto bad; - partial_name = PyUnicode_Join(sep, slice); - } - PyErr_Format( - PyExc_ModuleNotFoundError, - "No module named '%U'", partial_name); -bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; -} -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { - PyObject *imported_module; -#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ - CYTHON_COMPILING_IN_GRAAL - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - return NULL; - imported_module = __Pyx_PyDict_GetItemStr(modules, name); - Py_XINCREF(imported_module); -#else - imported_module = PyImport_GetModule(name); -#endif - return imported_module; -} -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { - Py_ssize_t i, nparts; -#if CYTHON_ASSUME_SAFE_SIZE - nparts = PyTuple_GET_SIZE(parts_tuple); -#else - nparts = PyTuple_Size(parts_tuple); - if (nparts < 0) return NULL; -#endif - for (i=1; i < nparts && module; i++) { - PyObject *part, *submodule; -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - part = PyTuple_GET_ITEM(parts_tuple, i); -#else - part = __Pyx_PySequence_ITEM(parts_tuple, i); - if (!part) return NULL; -#endif - submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(part); -#endif - Py_DECREF(module); - module = submodule; - } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); - } return module; } -static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) - return module; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; - } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -} -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec); - if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_initializing); - if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { - Py_DECREF(spec); - spec = NULL; - } - Py_XDECREF(unsafe); - } - if (likely(!spec)) { - PyErr_Clear(); - return module; - } - Py_DECREF(spec); - Py_DECREF(module); - } else if (PyErr_Occurred()) { - PyErr_Clear(); - } -#endif - return __Pyx__ImportDottedModule(name, parts_tuple); -} -/* ListPack */ -static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { - va_list va; - PyObject *l = PyList_New(n); - va_start(va, n); - if (unlikely(!l)) goto end; - for (Py_ssize_t i=0; i__pyx_d, level); } /* ImportFrom */ @@ -13889,7 +13923,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__2); + module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__3); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } @@ -13915,7 +13949,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { return value; } -/* GetTopmostException */ +/* GetTopmostException (used by SaveResetException) */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) @@ -13997,20 +14031,16 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject } #endif -/* FetchSharedCythonModule */ -static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); -} - -/* dict_setdefault */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, - int is_safe_type) { +/* dict_setdefault (used by FetchCommonType) */ +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) { PyObject* value; - CYTHON_MAYBE_UNUSED_VAR(is_safe_type); -#if CYTHON_COMPILING_IN_LIMITED_API - value = PyObject_CallMethod(d, "setdefault", "OO", key, default_value); -#elif PY_VERSION_HEX >= 0x030d0000 +#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4) PyDict_SetDefaultRef(d, key, default_value, &value); +#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + PyObject *args[] = {d, key, default_value}; + value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#elif CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL); #else value = PyDict_SetDefault(d, key, default_value); if (unlikely(!value)) return NULL; @@ -14019,7 +14049,57 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke return value; } -/* FetchCommonType */ +/* AddModuleRef (used by FetchSharedCythonModule) */ +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) { + PyObject *module_dict = PyImport_GetModuleDict(); + PyObject *m; + if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) { + return NULL; + } + if (m != NULL && PyModule_Check(m)) { + return m; + } + Py_XDECREF(m); + m = PyModule_NewObject(name); + if (m == NULL) + return NULL; + if (PyDict_CheckExact(module_dict)) { + PyObject *new_m; + (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m); + Py_DECREF(m); + return new_m; + } else { + if (PyObject_SetItem(module_dict, name, m) != 0) { + Py_DECREF(m); + return NULL; + } + return m; + } + } + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *py_name = PyUnicode_FromString(name); + if (!py_name) return NULL; + PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name); + Py_DECREF(py_name); + return module; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif + +/* FetchSharedCythonModule (used by FetchCommonType) */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); +} + +/* FetchCommonType (used by CommonTypesMetaclass) */ #if __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases); @@ -14092,11 +14172,13 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyOb } else if (unlikely(get_item_ref_result == -1)) { goto bad; } - CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromMetaclass(metaclass, abi_module, spec, bases); + cached_type = __Pyx_PyType_FromMetaclass( + metaclass, + CYTHON_USE_MODULE_STATE ? module : abi_module, + spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; - new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1); + new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type); if (unlikely(new_cached_type != cached_type)) { if (unlikely(!new_cached_type)) goto bad; Py_DECREF(cached_type); @@ -14122,26 +14204,39 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyOb goto done; } -/* CommonTypesMetaclass */ -PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { +/* CommonTypesMetaclass (used by CythonFunctionShared) */ +static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); } +#if __PYX_LIMITED_VERSION_HEX < 0x030A0000 +static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) { + PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types"); + return NULL; +} +static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) { + PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable"); + return -1; +} +#endif static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = { {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL}, {0, 0, 0, 0, 0} }; static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = { {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset}, + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call}, + {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call}, + {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr}, + #endif {0, 0} }; static PyType_Spec __pyx_CommonTypesMetaclass_spec = { __PYX_TYPE_MODULE_PREFIX "_common_types_metatype", 0, 0, -#if PY_VERSION_HEX >= 0x030A0000 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | -#endif Py_TPFLAGS_DEFAULT, __pyx_CommonTypesMetaclass_slots }; @@ -14152,13 +14247,14 @@ static int __pyx_CommonTypesMetaclass_init(PyObject *module) { return -1; } mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); + Py_DECREF(bases); if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { return -1; } return 0; } -/* PyMethodNew */ +/* PyMethodNew (used by CythonFunctionShared) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *result; @@ -14184,15 +14280,20 @@ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *ty } #endif -/* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +/* PyVectorcallFastCallDict (used by CythonFunctionShared) */ +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; - Py_ssize_t i, pos; + Py_ssize_t i; + #if CYTHON_AVOID_BORROWED_REFS + PyObject *pos; + #else + Py_ssize_t pos; + #endif size_t j; PyObject *key, *value; unsigned long keys_are_strings; @@ -14214,17 +14315,16 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector return NULL; } kwvalues = newargs + nargs; - pos = i = 0; + pos = 0; + i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; - while (PyDict_Next(kw, &pos, &key, &value)) { + while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) { keys_are_strings &= #if CYTHON_COMPILING_IN_LIMITED_API PyType_GetFlags(Py_TYPE(key)); #else Py_TYPE(key)->tp_flags; #endif - Py_INCREF(key); - Py_INCREF(value); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; #else @@ -14239,6 +14339,9 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } res = vc(func, newargs, nargs, kwnames); cleanup: + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(pos); + #endif Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); @@ -14267,7 +14370,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ } #endif -/* CythonFunctionShared */ +/* CythonFunctionShared (used by CythonFunction) */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { if (__Pyx_CyFunction_Check(func)) { @@ -14419,9 +14522,11 @@ __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void __Pyx_END_CRITICAL_SECTION(); return 0; } +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject * -__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) @@ -14430,36 +14535,7 @@ __Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) Py_INCREF(op->func_dict); return op->func_dict; } -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - PyObject *result; - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_dict_locked(op); - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - Py_INCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->func_dict, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; -} +#endif static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { @@ -14587,6 +14663,7 @@ __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { __Pyx_END_CRITICAL_SECTION(); return result; } +static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value); static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -14601,8 +14678,54 @@ __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, vo __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_annotations, value); __Pyx_END_CRITICAL_SECTION(); + if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists((PyObject*) op, Py_None) < 0)) return -1; return 0; } +static int +__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) { + /* Return 1 if the function dict exists, 0 otherwise. This cannot fail: + * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */ +#if CYTHON_COMPILING_IN_PYPY + *dict = PyObject_GenericGetDict(op_in, NULL); +#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000 + *dict = ((__pyx_CyFunctionObject*) op_in)->func_dict; +#else + PyObject **dictptr = _PyObject_GetDictPtr(op_in); + *dict = likely(dictptr) ? *dictptr : NULL; +#endif + return *dict ? 1 : 0; +} +static int +__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) { + PyObject *dict; + int dict_found; + *annotate = NULL; + dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict); + if (!dict_found) return 0; + return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate); +} +static int +__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) { + PyObject *dict; + int dict_found; + dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict); + if (!dict_found) return 0; + return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value); +} +static int +__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) { + PyObject *dict; + int result; +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + dict = __Pyx_CyFunction_get_dict((__pyx_CyFunctionObject*) op_in, NULL); +#else + dict = PyObject_GenericGetDict(op_in, NULL); +#endif + if (unlikely(!dict)) return -1; + result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value); + Py_DECREF(dict); + return result; +} static PyObject * __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; @@ -14615,14 +14738,88 @@ __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { return result; } static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { - PyObject *result; +__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) { + PyObject *annotate = NULL; + PyObject *result = NULL; + __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in; CYTHON_UNUSED_VAR(context); - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + result = __Pyx_XNewRef(op->func_annotations); + __Pyx_END_CRITICAL_SECTION(); + if (result) return result; + if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL; + if (!annotate || annotate == Py_None) { + Py_XDECREF(annotate); + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; + } + PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE + if (likely(format)) { + result = __Pyx_PyObject_CallOneArg(annotate, format); + Py_DECREF(format); + } + Py_DECREF(annotate); + if (unlikely(!result)) return NULL; + if (unlikely(!PyDict_Check(result))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict"); + Py_DECREF(result); + return NULL; + } + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result)); __Pyx_END_CRITICAL_SECTION(); return result; } +static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *args) { + CYTHON_UNUSED_VAR(args); + if (unlikely(!self)) { + PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument"); + } + Py_XINCREF(self); + return self; +} +static PyMethodDef __Pyx_CyFunction_annotate_method = { + "__annotate__", + (PyCFunction)(void (*)(void))__Pyx_CyFunction_annotate_impl, + METH_VARARGS, + "Placeholder __annotate__ function to allow 'functools.wraps' to work " + "on Cython functions." +}; +static PyObject * +__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) { + PyObject *annotate = NULL; + CYTHON_UNUSED_VAR(context); + if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL; + if (annotate) return annotate; + PyObject *annotations = __Pyx_CyFunction_get_annotations(op_in, NULL); + if (unlikely(!annotations)) return NULL; + PyObject *method = PyCFunction_New( + &__Pyx_CyFunction_annotate_method, + annotations); + Py_DECREF(annotations); + return method; +} +static int +__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted"); + return -1; + } + if (unlikely(value != Py_None && !PyCallable_Check(value))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None"); + return -1; + } + if (value != Py_None) { + __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in; + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + Py_CLEAR(op->func_annotations); + __Pyx_END_CRITICAL_SECTION(); + } + return __Pyx_CyFunction_set_annotate_in_dict(op_in, value); +} static PyObject * __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; @@ -14635,7 +14832,6 @@ __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { - Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } @@ -14721,8 +14917,13 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, + {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, +#else + {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, + {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, +#endif {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, @@ -14733,6 +14934,7 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0}, {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, @@ -14743,9 +14945,11 @@ static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#endif #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, @@ -14801,7 +15005,9 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_XINCREF(module); cf->m_module = module; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API op->func_dict = NULL; +#endif op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; @@ -14855,14 +15061,19 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func_dict); +#elif PY_VERSION_HEX < 0x030d0000 + _PyObject_ClearManagedDict((PyObject*)m); +#else + PyObject_ClearManagedDict((PyObject*)m); +#endif Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { @@ -14870,7 +15081,6 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } -#endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); @@ -14903,17 +15113,29 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func_dict); +#else + { + int e = +#if PY_VERSION_HEX < 0x030d0000 + _PyObject_VisitManagedDict +#else + PyObject_VisitManagedDict +#endif + ((PyObject*)m, visit, arg); + if (e != 0) return e; + } +#endif __Pyx_VISIT_CONST(m->func_name); __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); __Pyx_VISIT_CONST(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); -#endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_annotations); Py_VISIT(m->func_is_coroutine); Py_VISIT(m->defaults); return 0; @@ -15015,7 +15237,7 @@ static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *a static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE @@ -15054,7 +15276,7 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; @@ -15076,11 +15298,7 @@ static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionO static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -15115,11 +15333,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -15154,11 +15368,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -15189,11 +15399,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -15218,7 +15424,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); + #if PY_VERSION_HEX < 0x030e00A6 + size_t nargs_value = (size_t) nargs; + #else + Py_ssize_t nargs_value = nargs; + #endif + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames); } #endif static PyType_Slot __pyx_CyFunctionType_slots[] = { @@ -15247,9 +15458,10 @@ static PyType_Spec __pyx_CyFunctionType_spec = { _Py_TPFLAGS_HAVE_VECTORCALL | #endif #endif // CYTHON_METH_FASTCALL -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | +#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_TPFLAGS_MANAGED_DICT | #endif + Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; @@ -15298,7 +15510,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual return op; } -/* CalculateMetaclass */ +/* CalculateMetaclass (used by Py3ClassCreate) */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_SIZE @@ -15340,7 +15552,7 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas return (PyObject*) metaclass; } -/* PyObjectLookupSpecial */ +/* PyObjectLookupSpecial (used by Py3ClassCreate) */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; @@ -15416,55 +15628,44 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj return result; } -/* CLineInTraceback */ +/* CLineInTraceback (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o)) +#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL); +#else +PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) { + PyObject **dict_ptr = _PyObject_GetDictPtr(o); + return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL; +} +#endif static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { - PyObject *use_cline; + PyObject *use_cline = NULL; PyObject *ptype, *pvalue, *ptraceback; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject **cython_runtime_dict; -#endif + PyObject *cython_runtime_dict; CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); -#if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); + cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { - __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict); __PYX_PY_DICT_LOOKUP_IF_MODIFIED( - use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) - Py_XINCREF(use_cline); - __Pyx_END_CRITICAL_SECTION(); - } else -#endif - { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); - if (use_cline_obj) { - use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; - Py_INCREF(use_cline); - Py_DECREF(use_cline_obj); - } else { - PyErr_Clear(); - use_cline = NULL; - } - } - if (!use_cline) { - c_line = 0; - (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); + use_cline, cython_runtime_dict, + __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False)) } - else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } Py_XDECREF(use_cline); + Py_XDECREF(cython_runtime_dict); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif -/* CodeObjectCache */ +/* CodeObjectCache (used by AddTraceback) */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -15616,8 +15817,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { - (void) __pyx_cfilenm; - (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = __pyx_find_code_object(c_line ? -c_line : py_line); @@ -15626,7 +15826,11 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); + if (c_line) { + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + } else { + py_funcname = PyUnicode_FromString(funcname); + } if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; @@ -15751,7 +15955,7 @@ __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) result = name; name = NULL; } else { - result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__3); + result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__4); } goto done; } @@ -15773,7 +15977,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif @@ -15781,10 +15985,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { } else { if (sizeof(long) <= sizeof(long)) { return PyLong_FromLong((long) value); -#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif } } { @@ -15828,7 +16030,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { } } -/* CIntFromPyVerify */ +/* CIntFromPyVerify (used by CIntFromPy) */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ @@ -15924,10 +16126,8 @@ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -15996,10 +16196,8 @@ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif } } { @@ -16178,10 +16376,8 @@ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -16250,10 +16446,8 @@ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif } } { @@ -16445,7 +16639,40 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj } #endif -/* SwapException */ +/* GetRuntimeVersion */ +#if __PYX_LIMITED_VERSION_HEX < 0x030b0000 +void __Pyx_init_runtime_version(void) { + if (__Pyx_cached_runtime_version == 0) { + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + __Pyx_cached_runtime_version = version; + } +} +#endif +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + return Py_Version & ~0xFFUL; +#else + return __Pyx_cached_runtime_version; +#endif +} + +/* SwapException (used by CoroutineBase) */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; @@ -16499,7 +16726,7 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, } #endif -/* IterNextPlain */ +/* IterNextPlain (used by CoroutineBase) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) { if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache)) @@ -16522,7 +16749,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { #endif } -/* ReturnWithStopIteration */ +/* ReturnWithStopIteration (used by CoroutineBase) */ static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) { if (value == Py_None) { @@ -16576,7 +16803,7 @@ static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { Py_DECREF(exc); } -/* CoroutineBase */ +/* CoroutineBase (used by Generator) */ #if !CYTHON_COMPILING_IN_LIMITED_API #include #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) @@ -17187,7 +17414,8 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject ret = __Pyx_PyObject_Call(meth, args, NULL); } else { PyObject *cargs[4] = {NULL, typ, val, tb}; - ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + size_t nargs = 1U + (val != NULL) + (tb != NULL); + ret = __Pyx_PyObject_FastCall(meth, cargs+1, nargs | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } Py_DECREF(meth); } @@ -17259,7 +17487,9 @@ static int __Pyx_Coroutine_clear(PyObject *self) { static void __Pyx_Coroutine_dealloc(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject_GC_UnTrack(gen); + #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API if (gen->gi_weakreflist != NULL) + #endif PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); @@ -17382,14 +17612,10 @@ __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void __Pyx_Py_XDECREF_SET(self->gi_qualname, value); return 0; } -static PyObject * -__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) -{ #if !CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx__Coroutine_get_frame_locked(__pyx_CoroutineObject *self) { PyObject *frame; - #if PY_VERSION_HEX >= 0x030d0000 - Py_BEGIN_CRITICAL_SECTION(self); - #endif frame = self->gi_frame; if (!frame) { if (unlikely(!self->gi_code)) { @@ -17414,9 +17640,17 @@ __Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) } } Py_INCREF(frame); - #if PY_VERSION_HEX >= 0x030d0000 - Py_END_CRITICAL_SECTION(); - #endif + return frame; +} +#endif +static PyObject * +__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) +{ +#if !CYTHON_COMPILING_IN_LIMITED_API + PyObject *frame; + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)self); + frame = __Pyx__Coroutine_get_frame_locked(self); + __Pyx_END_CRITICAL_SECTION(); return frame; #else CYTHON_UNUSED_VAR(self); @@ -17460,7 +17694,9 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( #if CYTHON_USE_EXC_INFO_STACK gen->gi_exc_state.previous_item = NULL; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API gen->gi_weakreflist = NULL; +#endif Py_XINCREF(qualname); gen->gi_qualname = qualname; Py_XINCREF(name); @@ -17470,40 +17706,32 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( Py_XINCREF(code); gen->gi_code = code; gen->gi_frame = NULL; +#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) + memset(gen->__pyx_pymonitoring_state, 0, sizeof(gen->__pyx_pymonitoring_state)); + gen->__pyx_pymonitoring_version = 0; +#endif PyObject_GC_Track(gen); return gen; } static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) { char result; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen); result = gen->is_running; gen->is_running = 1; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif + __Pyx_END_CRITICAL_SECTION(); return result; } static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) { - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen); assert(gen->is_running); gen->is_running = 0; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif + __Pyx_END_CRITICAL_SECTION(); } static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) { char result; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen); result = gen->is_running; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif + __Pyx_END_CRITICAL_SECTION(); return result; } static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) { @@ -17549,7 +17777,9 @@ static PyMemberDef __pyx_Generator_memberlist[] = { PyDoc_STR("object being iterated by 'yield from', or None")}, {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, +#endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { @@ -17583,10 +17813,11 @@ static PyType_Spec __pyx_GeneratorType_spec = { __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | +#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_TPFLAGS_MANAGED_WEAKREF | #endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, + Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND, __pyx_GeneratorType_slots }; #if __PYX_HAS_PY_AM_SEND == 2 @@ -17618,36 +17849,6 @@ static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { return retval; } -/* GetRuntimeVersion */ -static unsigned long __Pyx_get_runtime_version(void) { -#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 - return Py_Version & ~0xFFUL; -#else - static unsigned long __Pyx_cached_runtime_version = 0; - if (__Pyx_cached_runtime_version == 0) { - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); - ++i; - } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; - } - __Pyx_cached_runtime_version = version; - } - return __Pyx_cached_runtime_version; -#endif -} - /* CheckBinaryVersion */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; @@ -17731,9 +17932,13 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1 + if (likely(result)) + result->_co_firsttraceable = 0; + #endif return result; } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY +#elif !CYTHON_COMPILING_IN_PYPY #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else @@ -17745,10 +17950,10 @@ static PyObject* __Pyx_PyCode_New( PyObject * const *varnames, PyObject *filename, PyObject *funcname, - const char *line_table, + PyObject *line_table, PyObject *tuple_dedup_map ) { - PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL; + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL; Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; PyObject *varnames_tuple = PyTuple_New(var_count); if (unlikely(!varnames_tuple)) return NULL; @@ -17769,11 +17974,12 @@ static PyObject* __Pyx_PyCode_New( #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(varnames_tuple_dedup); #endif - if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL - && !CYTHON_COMPILING_IN_GRAAL) { - line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length); - if (unlikely(!line_table_bytes)) goto done; - Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3; + if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) { + Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(line_table_length == -1)) goto done; + #endif + Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL; code_bytes = PyBytes_FromStringAndSize(NULL, code_len); if (unlikely(!code_bytes)) goto done; char* c_code_bytes = PyBytes_AsString(code_bytes); @@ -17796,11 +18002,10 @@ static PyObject* __Pyx_PyCode_New( filename, funcname, (int) descr.first_line, - (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes ); done: Py_XDECREF(code_bytes); - Py_XDECREF(line_table_bytes); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(varnames_tuple_dedup); #endif @@ -17808,30 +18013,68 @@ static PyObject* __Pyx_PyCode_New( return code_obj; } -/* InitStrings */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { - while (t->s) { - PyObject *str; - if (t->is_unicode) { - if (t->intern) { - str = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); - } else { - str = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - str = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - if (!str) - return -1; - *target = str; - if (PyObject_Hash(str) == -1) - return -1; - ++t; - ++target; +/* DecompressString */ +static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) { + PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed; + const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib"; + PyObject *methodname = PyUnicode_FromString("decompress"); + if (unlikely(!methodname)) return NULL; + #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000 + if (algo == 3) { + PyObject *fromlist = Py_BuildValue("[O]", methodname); + if (unlikely(!fromlist)) goto bad; + module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + } else + #endif + module = PyImport_ImportModule(module_name); + if (unlikely(!module)) goto import_failed; + decompress = PyObject_GetAttr(module, methodname); + if (unlikely(!decompress)) goto import_failed; + { + #ifdef __cplusplus + char *memview_bytes = const_cast(s); + #else + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wcast-qual" + #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-qual" + #endif + char *memview_bytes = (char*) s; + #if defined(__clang__) + #pragma clang diagnostic pop + #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) + #pragma GCC diagnostic pop + #endif + #endif + #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ) + int memview_flags = 0x100; + #else + int memview_flags = PyBUF_READ; + #endif + compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags); } - return 0; + if (unlikely(!compressed_bytes)) { + Py_DECREF(decompress); + goto bad; + } + decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL); + Py_DECREF(compressed_bytes); + Py_DECREF(decompress); + Py_DECREF(module); + Py_DECREF(methodname); + return decompressed; +import_failed: + PyErr_Format(PyExc_ImportError, + "Failed to import '%.20s.decompress' - cannot initialise module strings. " + "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.", + module_name, algo); +bad: + Py_XDECREF(module); + Py_DECREF(methodname); + return NULL; } #include @@ -18053,7 +18296,7 @@ static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { return __Pyx_NewRef(Py_None); } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { - return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); + return __Pyx_NewRef(b ? Py_True: Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { return PyLong_FromSize_t(ival); diff --git a/constraint/problem.py b/constraint/problem.py index 0ae1e07..8863248 100644 --- a/constraint/problem.py +++ b/constraint/problem.py @@ -1,15 +1,14 @@ """Module containing the code for problem definitions.""" import copy -from warnings import warn +from collections.abc import Callable, Hashable, Sequence from operator import itemgetter -from typing import Callable, Optional, Union -from collections.abc import Sequence, Hashable +from warnings import warn -from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint +from constraint.constraints import CompilableFunctionConstraint, Constraint, FunctionConstraint from constraint.domain import Domain -from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver from constraint.parser import compile_to_constraints +from constraint.solvers import OptimizedBacktrackingSolver, ParallelSolver, Solver try: from sys import _is_gil_enabled @@ -95,13 +94,15 @@ def addVariable(self, variable: Hashable, domain): Args: variable (hashable object): Object representing a problem variable - domain (list, tuple, or instance of :py:class:`Domain`): Set of items + domain (list, tuple, set, or instance of :py:class:`Domain`): Set of items defining the possible values that the given variable may assume """ if variable in self._variables: msg = f"Tried to insert duplicated variable {repr(variable)}" raise ValueError(msg) + if not isinstance(variable, (list, tuple, Domain)) and not hasattr(domain, "__getitem__"): + domain = list(domain) if isinstance(domain, Domain): domain = copy.deepcopy(domain) elif hasattr(domain, "__getitem__"): @@ -136,7 +137,7 @@ def addVariables(self, variables: Sequence, domain): for variable in variables: self.addVariable(variable, domain) - def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): + def addConstraint(self, constraint: Constraint | Callable | str, variables: Sequence | None = None): """Add a constraint to the problem. Example: @@ -254,7 +255,9 @@ def getSolutionsAsListDict( size_dict = len(solutions_dict) if size_list != size_dict: raise ValueError( - f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." + f"{size_list - size_dict} duplicate parameter configurations out of {size_dict} unique.", + f"Duplicate configs: {list(set([c for c in solutions_list if solutions_list.count(c) > 1]))}", + f"Constraints: {self._constraints}, {self._str_constraints}" ) return ( solutions_list, diff --git a/constraint/solvers.c b/constraint/solvers.c index 140573f..4e109d4 100644 --- a/constraint/solvers.c +++ b/constraint/solvers.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.1.2 */ +/* Generated by Cython 3.2.9 */ /* BEGIN: Cython Metadata { @@ -19,8 +19,16 @@ END: Cython Metadata */ #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ /* InitLimitedAPI */ -#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) +#if defined(Py_LIMITED_API) + #if !defined(CYTHON_LIMITED_API) #define CYTHON_LIMITED_API 1 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef _MSC_VER + #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.") + #else + #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead. + #endif #endif #include "Python.h" @@ -29,8 +37,8 @@ END: Cython Metadata */ #elif PY_VERSION_HEX < 0x03080000 #error Cython requires Python 3.8+. #else -#define __PYX_ABI_VERSION "3_1_2" -#define CYTHON_HEX_VERSION 0x030102F0 +#define __PYX_ABI_VERSION "3_2_9" +#define CYTHON_HEX_VERSION 0x030209F0 #define CYTHON_FUTURE_DIVISION 1 /* CModulePreamble */ #include @@ -55,9 +63,6 @@ END: Cython Metadata */ #define DL_EXPORT(t) t #endif #define __PYX_COMMA , -#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -#endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif @@ -90,7 +95,7 @@ END: Cython Metadata */ #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_ASSUME_SAFE_SIZE @@ -127,6 +132,8 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 @@ -194,6 +201,8 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX @@ -204,8 +213,6 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 - #undef CYTHON_CLINE_IN_TRACEBACK - #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS @@ -265,8 +272,11 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #ifndef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 1 + #endif + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 @@ -373,6 +383,15 @@ END: Cython Metadata */ #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif + #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000 + #undef CYTHON_IMMORTAL_CONSTANTS + #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work + #elif !defined(CYTHON_IMMORTAL_CONSTANTS) + #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) + #endif +#endif +#ifndef CYTHON_COMPRESS_STRINGS + #define CYTHON_COMPRESS_STRINGS 1 #endif #ifndef CYTHON_FAST_PYCCALL #define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL @@ -381,10 +400,9 @@ END: Cython Metadata */ #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #else -#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL) #endif #endif -#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #undef SHIFT #undef BASE @@ -460,35 +478,8 @@ END: Cython Metadata */ #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) -#ifdef _MSC_VER - #ifndef _MSC_STDINT_H_ - #if _MSC_VER < 1300 - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; - #else - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; - #endif - #endif - #if _MSC_VER < 1300 - #ifdef _WIN64 - typedef unsigned long long __pyx_uintptr_t; - #else - typedef unsigned int __pyx_uintptr_t; - #endif - #else - #ifdef _WIN64 - typedef unsigned __int64 __pyx_uintptr_t; - #else - typedef unsigned __int32 __pyx_uintptr_t; - #endif - #endif -#else - #include - typedef uintptr_t __pyx_uintptr_t; -#endif +#include +typedef uintptr_t __pyx_uintptr_t; #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 @@ -531,9 +522,9 @@ END: Cython Metadata */ #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000) #else - #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) @@ -637,6 +628,12 @@ static int __Pyx_init_co_variables(void); #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif +#ifndef Py_TPFLAGS_IMMUTABLETYPE + #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8) +#endif +#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION + #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7) +#endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif @@ -669,11 +666,6 @@ static int __Pyx_init_co_variables(void); #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) -#elif CYTHON_BACKPORT_VECTORCALL - typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, - size_t nargsf, PyObject *kwnames); - #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) - #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) @@ -703,7 +695,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(vo #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x03090000 +#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000) #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else @@ -720,6 +712,9 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(vo #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno)) #elif CYTHON_COMPILING_IN_GRAAL #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) @@ -810,7 +805,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #endif #define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) -#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#if CYTHON_USE_TYPE_SPECS #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ @@ -874,7 +869,10 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #endif #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else @@ -890,22 +888,55 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif -#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) - #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS +enum __Pyx_ReferenceSharing { + __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check + __Pyx_ReferenceSharing_OwnStrongReference, + __Pyx_ReferenceSharing_FunctionArgument, + __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar +}; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000 +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\ + (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\ + (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\ + (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0))) +#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1) +#else +#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) #else #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i) #endif -#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS - #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE) + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) +#else + #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\ + __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +#endif +#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_PyList_GetItemRef(o, i)) +#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\ + __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ + __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i)) #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\ + __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\ + __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i)) #endif +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_NewRef(PyList_GET_ITEM(o, i))) #else - #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) + #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\ + __Pyx_XNewRef(PyList_GetItem(o, i))) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) @@ -966,15 +997,6 @@ static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 - #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) -#else - static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { - PyObject *module = PyImport_AddModule(name); - Py_XINCREF(module); - return module; - } -#endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif @@ -1081,15 +1103,6 @@ static int __Pyx_init_co_variables(void) { #endif #endif #include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else @@ -1138,6 +1151,15 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif +#ifdef CYTHON_FREETHREADING_COMPATIBLE +#if CYTHON_FREETHREADING_COMPATIBLE +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED +#else +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED +#endif +#else +#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED +#endif #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING "" @@ -1340,7 +1362,7 @@ static const char* const __pyx_f[] = { "constraint/solvers.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* Atomics.proto */ +/* Atomics.proto (used by UnpackUnboundCMethod) */ #include #ifndef CYTHON_ATOMICS #define CYTHON_ATOMICS 1 @@ -1376,6 +1398,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C atomics") #elif defined(__PYX_DEBUG_ATOMICS) @@ -1400,6 +1423,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed) #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire) #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) #pragma message ("Using standard C++ atomics") #elif defined(__PYX_DEBUG_ATOMICS) @@ -1409,6 +1433,7 @@ static const char* const __pyx_f[] = { (__GNUC_MINOR__ > 1 ||\ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) #define __pyx_atomic_ptr_type void* + #define __pyx_nonatomic_ptr_type void* #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1) #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1) @@ -1424,6 +1449,12 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0) #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value) + static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { + __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } #ifdef __PYX_DEBUG_ATOMICS #warning "Using GNU atomics" #endif @@ -1434,6 +1465,7 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_ptr_type void* #undef __pyx_nonatomic_int_type #define __pyx_nonatomic_int_type long + #define __pyx_nonatomic_ptr_type void* #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer) #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1) #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1) @@ -1450,6 +1482,12 @@ static const char* const __pyx_f[] = { #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0) #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value) + static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) { + __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } #ifdef __PYX_DEBUG_ATOMICS #pragma message ("Using MSVC atomics") #endif @@ -1460,36 +1498,27 @@ static const char* const __pyx_f[] = { #warning "Not using atomics" #endif #endif -#if CYTHON_ATOMICS - #define __pyx_add_acquisition_count(memview)\ - __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview)) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview)) -#else - #define __pyx_add_acquisition_count(memview)\ - __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) - #define __pyx_sub_acquisition_count(memview)\ - __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) -#endif - -/* IncludeStructmemberH.proto */ -#include -/* CriticalSections.proto */ +/* CriticalSectionsDefinition.proto (used by CriticalSections) */ #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #define __Pyx_PyCriticalSection void* #define __Pyx_PyCriticalSection2 void* -#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs -#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs -#define __Pyx_PyCriticalSection_End1(cs) -#define __Pyx_PyCriticalSection_End2(cs) +#define __Pyx_PyCriticalSection_End(cs) +#define __Pyx_PyCriticalSection2_End(cs) #else #define __Pyx_PyCriticalSection PyCriticalSection #define __Pyx_PyCriticalSection2 PyCriticalSection2 -#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin -#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin -#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End -#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End +#define __Pyx_PyCriticalSection_End PyCriticalSection_End +#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End +#endif + +/* CriticalSections.proto (used by ParseKeywordsImpl) */ +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs) +#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs) +#else +#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin +#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin #endif #if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_BEGIN_CRITICAL_SECTION(o) { @@ -1499,6 +1528,9 @@ static const char* const __pyx_f[] = { #define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif +/* IncludeStructmemberH.proto (used by FixUpExtensionType) */ +#include + /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ @@ -1724,7 +1756,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr { #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) -/* PyErrExceptionMatches.proto */ +/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); @@ -1732,7 +1764,7 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif -/* PyThreadStateGet.proto */ +/* PyThreadStateGet.proto (used by PyErrFetchRestore) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; @@ -1750,7 +1782,7 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif -/* PyErrFetchRestore.proto */ +/* PyErrFetchRestore.proto (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) @@ -1775,20 +1807,20 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif -/* PyObjectGetAttrStr.proto */ +/* PyObjectGetAttrStr.proto (used by PyObjectGetAttrStrNoError) */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif -/* PyObjectGetAttrStrNoError.proto */ +/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); -/* TupleAndListFromArray.proto */ +/* TupleAndListFromArray.proto (used by fastcall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1796,13 +1828,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_s static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif -/* IncludeStringH.proto */ +/* IncludeStringH.proto (used by BytesEquals) */ #include -/* BytesEquals.proto */ +/* BytesEquals.proto (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); -/* UnicodeEquals.proto */ +/* UnicodeEquals.proto (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ @@ -1835,25 +1867,16 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #endif #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) -#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#if CYTHON_METH_FASTCALL #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start) #else -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS #endif -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static CYTHON_INLINE int __Pyx_ParseKeywords( - PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], - PyObject *kwds2, PyObject *values[], - Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, - const char* function_name, - int ignore_unknown_kwargs -); +/* py_dict_items.proto (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); -/* CallCFunction.proto */ +/* CallCFunction.proto (used by CallUnboundCMethod0) */ #define __Pyx_CallCFunction(cfunc, self, args)\ ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) #define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ @@ -1863,52 +1886,26 @@ static CYTHON_INLINE int __Pyx_ParseKeywords( #define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\ ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames) -/* PyFunctionFastCall.proto */ -#if CYTHON_FAST_PYCALL -#if !CYTHON_VECTORCALL -#define __Pyx_PyFunction_FastCall(func, args, nargs)\ - __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs); -#endif -#define __Pyx_BUILD_ASSERT_EXPR(cond)\ - (sizeof(char [1 - 2*!(cond)]) - 1) -#ifndef Py_MEMBER_SIZE -#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) -#endif -#if !CYTHON_VECTORCALL -#if PY_VERSION_HEX >= 0x03080000 - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets() - #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) -#else - static size_t __pyx_pyframe_localsplus_offset = 0; - #include "frameobject.h" - #define __Pxy_PyFrame_Initialize_Offsets()\ - ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ - (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) - #define __Pyx_PyFrame_GetLocalsplus(frame)\ - (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) -#endif -#endif -#endif - -/* PyObjectCall.proto */ +/* PyObjectCall.proto (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif -/* PyObjectCallMethO.proto */ +/* PyObjectCallMethO.proto (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif -/* PyObjectFastCall.proto */ +/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); -/* UnpackUnboundCMethod.proto */ +/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */ typedef struct { PyObject *type; PyObject **method_name; @@ -1941,6 +1938,59 @@ static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_Ca #define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) #endif +/* CallUnboundCMethod0.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + +/* py_dict_values.proto (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); + +/* OwnedDictNext.proto (used by ParseKeywordsImpl) */ +#if CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue); +#else +CYTHON_INLINE +static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue); +#endif + +/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywordsImpl.export */ +static int __Pyx_ParseKeywordsTuple( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name +); +static int __Pyx_ParseKeywordDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + /* CallUnboundCMethod2.proto */ CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); @@ -1950,15 +2000,26 @@ static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction * #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif +/* ParseKeywords.proto */ +static CYTHON_INLINE int __Pyx_ParseKeywords( + PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], + PyObject *kwds2, PyObject *values[], + Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); +/* ArgTypeTestFunc.export */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); @@ -1972,7 +2033,7 @@ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); -/* ListAppend.proto */ +/* ListAppend.proto (used by append) */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; @@ -1993,23 +2054,22 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif -/* PyObjectCall2Args.proto */ +/* PyObjectCall2Args.proto (used by PyObjectCallMethod1) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* PyObjectGetMethod.proto */ +/* PyObjectGetMethod.proto (used by PyObjectCallMethod1) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); +#endif -/* PyObjectCallMethod1.proto */ +/* PyObjectCallMethod1.proto (used by append) */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* dict_setdefault.proto */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value); /* PyObjectFastCallMethod.proto */ #if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000 @@ -2036,26 +2096,26 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #endif /* GetItemInt.proto */ -#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) -#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\ + int wraparound, int boundscheck, int unsafe_shared); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ - __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); + int wraparound, int boundscheck, int unsafe_shared); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); + int is_list, int wraparound, int boundscheck, int unsafe_shared); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS @@ -2090,25 +2150,45 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( /* UnicodeConcatInPlace.proto */ # if CYTHON_COMPILING_IN_CPYTHON #if CYTHON_REFNANNY - #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) + #define __Pyx_PyUnicode_ConcatInPlace(left, right, unsafe_shared) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, unsafe_shared, __pyx_refnanny) #else - #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right) + #define __Pyx_PyUnicode_ConcatInPlace(left, right, unsafe_shared) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, unsafe_shared) #endif - static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right + #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_DefinitelyUnique) + #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_OwnStrongReference) + #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_FunctionArgument) + #define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace(left, right) __Pyx_PyUnicode_ConcatInPlace(left, right, __Pyx_ReferenceSharing_SharedReference) + static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right, int unsafe_shared #if CYTHON_REFNANNY , void* __pyx_refnanny #endif ); #else -#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat -#endif -#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ - PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) - -/* RaiseException.proto */ +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace __Pyx_PyUnicode_Concat +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace __Pyx_PyUnicode_Concat +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace __Pyx_PyUnicode_Concat +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace __Pyx_PyUnicode_Concat +#endif +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlaceSafe(left, right)\ + ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_DefinitelyUniqueInPlace(left, right)) +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlaceSafe(left, right)\ + ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(left, right)) +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlaceSafe(left, right)\ + ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_FunctionArgumentInPlace(left, right)) +#define __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlaceSafe(left, right)\ + ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_SharedReferenceInPlace(left, right)) + +/* PyNotImplementedError_Check.proto */ +#define __Pyx_PyExc_NotImplementedError_Check(obj) __Pyx_TypeCheck(obj, PyExc_NotImplementedError) + +/* RaiseException.export */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); -/* PyObjectDelAttr.proto */ +/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 #define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL) #else @@ -2124,19 +2204,19 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif -/* PyObjectCallNoArg.proto */ +/* PyObjectCallNoArg.proto (used by PyObjectCallMethod0) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); -/* PyObjectCallMethod0.proto */ +/* PyObjectCallMethod0.proto (used by dict_iter) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); -/* RaiseNoneIterError.proto */ +/* RaiseNoneIterError.proto (used by UnpackTupleError) */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); -/* UnpackTupleError.proto */ +/* UnpackTupleError.proto (used by UnpackTuple2) */ static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); -/* UnpackTuple2.proto */ +/* UnpackTuple2.proto (used by dict_iter) */ static CYTHON_INLINE int __Pyx_unpack_tuple2( PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( @@ -2171,44 +2251,52 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif -/* LimitedApiGetTypeDict.proto */ +/* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp); #endif -/* SetItemOnTypeDict.proto */ +/* SetItemOnTypeDict.proto (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v); #define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v) -/* FixUpExtensionType.proto */ +/* FixUpExtensionType.proto (used by FetchCommonType) */ static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); -/* FetchSharedCythonModule.proto */ +/* AddModuleRef.proto (used by FetchSharedCythonModule) */ +#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\ + __PYX_LIMITED_VERSION_HEX < 0x030d0000) + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name); +#else + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#endif + +/* FetchSharedCythonModule.proto (used by FetchCommonType) */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); -/* FetchCommonType.proto */ +/* FetchCommonType.proto (used by CommonTypesMetaclass) */ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases); -/* CommonTypesMetaclass.proto */ +/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */ static int __pyx_CommonTypesMetaclass_init(PyObject *module); #define __Pyx_CommonTypesMetaclass_USED -/* CallTypeTraverse.proto */ +/* CallTypeTraverse.proto (used by CythonFunctionShared) */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 #else static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif -/* PyMethodNew.proto */ +/* PyMethodNew.proto (used by CythonFunctionShared) */ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); -/* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */ +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif -/* CythonFunctionShared.proto */ +/* CythonFunctionShared.proto (used by CythonFunction) */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 @@ -2238,14 +2326,15 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL ||\ - (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) +#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL __pyx_vectorcallfunc func_vectorcall; #endif #if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_dict; +#endif PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; @@ -2290,7 +2379,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) @@ -2304,7 +2393,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, PyObject *module, PyObject *globals, PyObject* code); -/* PyObjectVectorCallKwBuilder.proto */ +/* PyObjectVectorCallKwBuilder.proto (used by PyObjectVectorCallMethodKwBuilder) */ CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); #if CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03090000 @@ -2340,16 +2429,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); #define __Pyx_PyObject_Pop(L) __Pyx__PyObject_Pop(L) #endif -/* CallUnboundCMethod0.proto */ -CYTHON_UNUSED -static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); -#else -#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) -#endif +/* PyRuntimeError_Check.proto */ +#define __Pyx_PyExc_RuntimeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_RuntimeError) -/* GetException.proto */ +/* GetException.proto (used by pep479) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); @@ -2360,7 +2443,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /* pep479.proto */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); -/* IterNextPlain.proto */ +/* IterNextPlain.proto (used by IterNext) */ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator); #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void); @@ -2370,7 +2453,7 @@ static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void); #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); -/* GetTopmostException.proto */ +/* GetTopmostException.proto (used by SaveResetException) */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif @@ -2386,13 +2469,16 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif +/* PyStopIteration_Check.proto */ +#define __Pyx_PyExc_StopIteration_Check(obj) __Pyx_TypeCheck(obj, PyExc_StopIteration) + /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } -/* PyDictVersioning.proto */ +/* PyDictVersioning.proto (used by GetModuleGlobalName) */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) @@ -2403,7 +2489,7 @@ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* s static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ - (VAR) = __pyx_dict_cached_value;\ + (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ @@ -2439,6 +2525,11 @@ static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_ve static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif +/* PyRange_Check.proto */ +#if CYTHON_COMPILING_IN_PYPY && !defined(PyRange_Check) + #define PyRange_Check(obj) __Pyx_TypeCheck((obj), &PyRange_Type) +#endif + /* py_dict_keys.proto */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); @@ -2513,13 +2604,30 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { #endif } -/* GetAttr.proto */ +/* GetAttr.proto (used by Globals) */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* Globals.proto */ static PyObject* __Pyx_Globals(void); -/* ValidateBasesTuple.proto */ +/* CheckTypeForFreelists.proto */ +#if CYTHON_USE_FREELISTS +#if CYTHON_USE_TYPE_SPECS +#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp))) +#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS Py_TPFLAGS_IS_ABSTRACT +#else +#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size))) +#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE) +#endif +#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\ + (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\ + (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS))) +#endif + +/* AllocateExtensionType.proto */ +static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final); + +/* ValidateBasesTuple.proto (used by PyType_Ready) */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif @@ -2527,15 +2635,18 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); +/* HasAttr.proto (used by ImportImpl) */ +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) +#else +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); +#endif -/* ImportDottedModule.proto */ -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); +/* ImportImpl.export */ +static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level); -/* ListPack.proto */ -static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); +/* Import.proto */ +static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); @@ -2551,7 +2662,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif -/* CalculateMetaclass.proto */ +/* CalculateMetaclass.proto (used by Py3ClassCreate) */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* Py3ClassCreate.proto */ @@ -2566,14 +2677,14 @@ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CyFunctionClassCell.proto */ static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj); -/* CLineInTraceback.proto */ +/* CLineInTraceback.proto (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #else #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif -/* CodeObjectCache.proto */ +/* CodeObjectCache.proto (used by AddTraceback) */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject __Pyx_CachedCodeObjectType; #else @@ -2654,7 +2765,16 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) #endif -/* SwapException.proto */ +/* GetRuntimeVersion.proto */ +#if __PYX_LIMITED_VERSION_HEX < 0x030b0000 +static unsigned long __Pyx_cached_runtime_version = 0; +static void __Pyx_init_runtime_version(void); +#else +#define __Pyx_init_runtime_version() +#endif +static unsigned long __Pyx_get_runtime_version(void); + +/* SwapException.proto (used by CoroutineBase) */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); @@ -2662,10 +2782,10 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif -/* ReturnWithStopIteration.proto */ +/* ReturnWithStopIteration.proto (used by CoroutineBase) */ static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext); -/* CoroutineBase.proto */ +/* CoroutineBase.proto (used by Generator) */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); #if CYTHON_USE_EXC_INFO_STACK @@ -2682,7 +2802,9 @@ typedef struct __pyx_CoroutineObject { __pyx_coroutine_body_t body; PyObject *closure; __Pyx_ExcInfoStruct gi_exc_state; +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API PyObject *gi_weakreflist; +#endif PyObject *classobj; PyObject *yieldfrom; __Pyx_pyiter_sendfunc yieldfrom_am_send; @@ -2750,12 +2872,12 @@ static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); -/* GetRuntimeVersion.proto */ -static unsigned long __Pyx_get_runtime_version(void); - /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); +/* DecompressString.proto */ +static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo); + /* MultiPhaseInitModuleState.proto */ #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE static PyObject *__Pyx_State_FindModule(void*); @@ -2813,264 +2935,11 @@ int __pyx_module_is_main_constraint__solvers = 0; /* Implementation of "constraint.solvers" */ /* #### Code section: global_var ### */ -static PyObject *__pyx_builtin_NotImplementedError; -static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_builtin_StopIteration; -static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_super; static PyObject *__pyx_builtin_sorted; static PyObject *__pyx_builtin_compile; /* #### Code section: string_decls ### */ -static const char __pyx_k_[] = "."; -static const char __pyx_k_c[] = "c"; -static const char __pyx_k_v[] = "v"; -static const char __pyx_k_x[] = "x"; -static const char __pyx_k__2[] = "?"; -static const char __pyx_k__3[] = "\220\021"; -static const char __pyx_k__4[] = "\220!"; -static const char __pyx_k__5[] = "_"; -static const char __pyx_k_aq[] = "\220[\240\001\240\021\240$\240a\240q\250\001"; -static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k_UUV[] = "\320\004'\320':\320:U\320UV"; -static const char __pyx_k_doc[] = "__doc__"; -static const char __pyx_k_get[] = "get"; -static const char __pyx_k_key[] = "key"; -static const char __pyx_k_lst[] = "lst"; -static const char __pyx_k_map[] = "map"; -static const char __pyx_k_msg[] = "msg"; -static const char __pyx_k_pop[] = "pop"; -static const char __pyx_k_q_Q[] = "\320\004\027\220q\360\020\000\t\r\320\014\035\230Q"; -static const char __pyx_k_val[] = "val"; -static const char __pyx_k_var[] = "var"; -static const char __pyx_k_arcs[] = "arcs"; -static const char __pyx_k_args[] = "args"; -static const char __pyx_k_bool[] = "bool"; -static const char __pyx_k_copy[] = "copy"; -static const char __pyx_k_dict[] = "dict"; -static const char __pyx_k_exec[] = "exec"; -static const char __pyx_k_exit[] = "__exit__"; -static const char __pyx_k_func[] = "__func__"; -static const char __pyx_k_init[] = "__init__"; -static const char __pyx_k_item[] = "item"; -static const char __pyx_k_iter[] = "iter"; -static const char __pyx_k_keys[] = "keys"; -static const char __pyx_k_list[] = "list"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_next[] = "next"; -static const char __pyx_k_rand[] = "rand"; -static const char __pyx_k_self[] = "self"; -static const char __pyx_k_send[] = "send"; -static const char __pyx_k_sort[] = "sort"; -static const char __pyx_k_spec[] = "__spec__"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_vals[] = "vals"; -static const char __pyx_k_check[] = "check"; -static const char __pyx_k_class[] = "__class__"; -static const char __pyx_k_close[] = "close"; -static const char __pyx_k_count[] = "count"; -static const char __pyx_k_enter[] = "__enter__"; -static const char __pyx_k_items[] = "items"; -static const char __pyx_k_queue[] = "queue"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_steps[] = "steps"; -static const char __pyx_k_super[] = "super"; -static const char __pyx_k_throw[] = "throw"; -static const char __pyx_k_types[] = "types"; -static const char __pyx_k_value[] = "value"; -static const char __pyx_k_AQd_1A[] = "\230\033\240A\240Q\240d\250!\2501\250A"; -static const char __pyx_k_Domain[] = "Domain"; -static const char __pyx_k_Solver[] = "Solver"; -static const char __pyx_k_append[] = "append"; -static const char __pyx_k_choice[] = "choice"; -static const char __pyx_k_doArc8[] = "doArc8"; -static const char __pyx_k_domain[] = "domain"; -static const char __pyx_k_enable[] = "enable"; -static const char __pyx_k_func_2[] = "_func"; -static const char __pyx_k_func_3[] = "func"; -static const char __pyx_k_lambda[] = ""; -static const char __pyx_k_module[] = "__module__"; -static const char __pyx_k_q_Ry_Q[] = "\320\004\027\220q\340\010\r\210R\210y\230\001\330\010\014\320\014\035\230Q\330\010\014\320\014!\240\021"; -static const char __pyx_k_rand_2[] = "_rand"; -static const char __pyx_k_random[] = "random"; -static const char __pyx_k_result[] = "result"; -static const char __pyx_k_return[] = "return"; -static const char __pyx_k_single[] = "single"; -static const char __pyx_k_sorted[] = "sorted"; -static const char __pyx_k_string[] = ""; -static const char __pyx_k_values[] = "values"; -static const char __pyx_k_1_Ja_IQ[] = "\320\004\027\220|\2401\360\022\000\t\r\210J\220a\330\010\014\210I\220Q"; -static const char __pyx_k_3awVWWX[] = "\300\032\3103\310a\310w\320VW\320WX"; -static const char __pyx_k_UUV_b_D[] = "\320\004'\320':\320:U\320UV\360\022\000\t\017\210b\220\004\220D\230\n\240!\330\010\016\320\016!\240\021\240!"; -static const char __pyx_k_compile[] = "compile"; -static const char __pyx_k_disable[] = "disable"; -static const char __pyx_k_domains[] = "domains"; -static const char __pyx_k_genexpr[] = "genexpr"; -static const char __pyx_k_getArcs[] = "getArcs"; -static const char __pyx_k_popitem[] = "popitem"; -static const char __pyx_k_prepare[] = "__prepare__"; -static const char __pyx_k_results[] = "results"; -static const char __pyx_k_shuffle[] = "shuffle"; -static const char __pyx_k_steps_2[] = "_steps"; -static const char __pyx_k_Hashable[] = "Hashable"; -static const char __pyx_k_add_note[] = "add_note"; -static const char __pyx_k_executor[] = "executor"; -static const char __pyx_k_fromkeys[] = "fromkeys"; -static const char __pyx_k_is_valid[] = "is_valid"; -static const char __pyx_k_mincount[] = "mincount"; -static const char __pyx_k_popState[] = "popState"; -static const char __pyx_k_qualname[] = "__qualname__"; -static const char __pyx_k_set_name[] = "__set_name__"; -static const char __pyx_k_variable[] = "variable"; -static const char __pyx_k_66QQR_b_D[] = "\320\004#\320#6\3206Q\320QR\360\022\000\t\017\210b\220\004\220D\230\n\240!\330\010\016\320\016!\240\021\240!"; -static const char __pyx_k_77RRS_b_D[] = "\320\004$\320$7\3207R\320RS\360\022\000\t\017\210b\220\004\220D\230\n\240!\330\010\016\320\016!\240\021\240!"; -static const char __pyx_k_chunksize[] = "chunksize"; -static const char __pyx_k_co_consts[] = "co_consts"; -static const char __pyx_k_first_var[] = "first_var"; -static const char __pyx_k_hideValue[] = "hideValue"; -static const char __pyx_k_isenabled[] = "isenabled"; -static const char __pyx_k_metaclass[] = "__metaclass__"; -static const char __pyx_k_minvalues[] = "minvalues"; -static const char __pyx_k_pushState[] = "pushState"; -static const char __pyx_k_solutions[] = "solutions"; -static const char __pyx_k_variable1[] = "variable1"; -static const char __pyx_k_variable2[] = "variable2"; -static const char __pyx_k_variables[] = "variables"; -static const char __pyx_k_Constraint[] = "Constraint"; -static const char __pyx_k_assignment[] = "assignment"; -static const char __pyx_k_conflicted[] = "conflicted"; -static const char __pyx_k_constraint[] = "constraint"; -static const char __pyx_k_list_tuple[] = "list[tuple]"; -static const char __pyx_k_othervalue[] = "othervalue"; -static const char __pyx_k_setdefault[] = "setdefault"; -static const char __pyx_k_77RRS_t1D_q[] = "\320\004$\320$7\3207R\320RS\330\010\017\210t\2201\220D\320\030(\250\001\250\031\260-\270q"; -static const char __pyx_k_77RRS_t_AYa[] = "\320\004$\320$7\3207R\320RS\330\010\017\210t\320\023$\240A\240Y\250a"; -static const char __pyx_k_77RRS_t_i_T[] = "\320\004$\320$7\3207R\320RS\330\010\017\210t\320\023)\250\021\250$\250i\260~\300T\310\021"; -static const char __pyx_k_BBn_o_J_J_K[] = "\320\000\031\320\031B\320Bn\360\000\000o\001J\002\360\000\000J\002K\002\340\004\005\330\022\023"; -static const char __pyx_k_assignments[] = "assignments"; -static const char __pyx_k_code_object[] = "code_object"; -static const char __pyx_k_constraints[] = "constraints"; -static const char __pyx_k_first_value[] = "first_value"; -static const char __pyx_k_func_string[] = "func_string"; -static const char __pyx_k_getSolution[] = "getSolution"; -static const char __pyx_k_mro_entries[] = "__mro_entries__"; -static const char __pyx_k_otherdomain[] = "otherdomain"; -static const char __pyx_k_pushdomains[] = "pushdomains"; -static const char __pyx_k_sorted_vars[] = "sorted_vars"; -static const char __pyx_k_Can_t_happen[] = "Can't happen"; -static const char __pyx_k_FunctionType[] = "FunctionType"; -static const char __pyx_k_RuntimeError[] = "RuntimeError"; -static const char __pyx_k_arcsvariable[] = "arcsvariable"; -static const char __pyx_k_forwardcheck[] = "forwardcheck"; -static const char __pyx_k_getSolutions[] = "getSolutions"; -static const char __pyx_k_initializing[] = "_initializing"; -static const char __pyx_k_is_coroutine[] = "_is_coroutine"; -static const char __pyx_k_process_mode[] = "process_mode"; -static const char __pyx_k_vconstraints[] = "vconstraints"; -static const char __pyx_k_StopIteration[] = "StopIteration"; -static const char __pyx_k_class_getitem[] = "__class_getitem__"; -static const char __pyx_k_list_Hashable[] = "list[Hashable]"; -static const char __pyx_k_othervariable[] = "othervariable"; -static const char __pyx_k_parallel_pool[] = "parallel_pool"; -static const char __pyx_k_vars_involved[] = "vars_involved"; -static const char __pyx_k_EQ_A_1_q_Qd_Qa[] = "\320\000$\320$E\300Q\340\004\022\220*\230A\330\004\022\220'\230\021\230-\240|\2601\330\004\013\210<\220q\230\013\240:\250Q\250d\260'\270\021\330\004\013\320\013\035\230Q\230a"; -static const char __pyx_k_ParallelSolver[] = "ParallelSolver"; -static const char __pyx_k_arcconstraints[] = "arcconstraints"; -static const char __pyx_k_forwardcheck_2[] = "_forwardcheck"; -static const char __pyx_k_process_mode_2[] = "_process_mode"; -static const char __pyx_k_remaining_vars[] = "remaining_vars"; -static const char __pyx_k_66QQR_t_1I_4q_1[] = "\320\004#\320#6\3206Q\320QR\330\010\017\210t\320\023#\2401\240I\250]\270!\330\010\t\330\014\023\2204\220q\230\001\330\017\020\330\014\023\2201"; -static const char __pyx_k_collections_abc[] = "collections.abc"; -static const char __pyx_k_getSolutionIter[] = "getSolutionIter"; -static const char __pyx_k_parallel_worker[] = "parallel_worker"; -static const char __pyx_k_unassigned_vars[] = "unassigned_vars"; -static const char __pyx_k_getSolutionsList[] = "getSolutionsList"; -static const char __pyx_k_local_assignment[] = "local_assignment"; -static const char __pyx_k_sorted_variables[] = "sorted_variables"; -static const char __pyx_k_constraint_domain[] = "constraint.domain"; -static const char __pyx_k_constraint_lookup[] = "constraint_lookup"; -static const char __pyx_k_dict_Hashable_any[] = "dict[Hashable, any]"; -static const char __pyx_k_requires_pickling[] = "requires_pickling"; -static const char __pyx_k_BacktrackingSolver[] = "BacktrackingSolver"; -static const char __pyx_k_FunctionConstraint[] = "FunctionConstraint"; -static const char __pyx_k_MinConflictsSolver[] = "MinConflictsSolver"; -static const char __pyx_k_Solver_getSolution[] = "Solver.getSolution"; -static const char __pyx_k_ThreadPoolExecutor[] = "ThreadPoolExecutor"; -static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; -static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; -static const char __pyx_k_concurrent_futures[] = "concurrent.futures"; -static const char __pyx_k_constraint_solvers[] = "constraint.solvers"; -static const char __pyx_k_constraints_lookup[] = "constraints_lookup"; -static const char __pyx_k_getSortedVariables[] = "getSortedVariables"; -static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; -static const char __pyx_k_ProcessPoolExecutor[] = "ProcessPoolExecutor"; -static const char __pyx_k_Solver_getSolutions[] = "Solver.getSolutions"; -static const char __pyx_k_compile_to_function[] = "compile_to_function"; -static const char __pyx_k_dict_Hashable_Domain[] = "dict[Hashable, Domain]"; -static const char __pyx_k_is_an_abstract_class[] = " is an abstract class"; -static const char __pyx_k_ParallelSolver___init[] = "ParallelSolver.__init__"; -static const char __pyx_k_constraint_solvers_py[] = "constraint/solvers.py"; -static const char __pyx_k_recursiveBacktracking[] = "recursiveBacktracking"; -static const char __pyx_k_66QQR_D_at9N_a_z_Yas_Q[] = "\320\004#\320#6\3206Q\320QR\330\010\024\220D\320\030.\250a\250t\2609\270N\310$\310a\330\010\017\210z\230\024\230Y\240a\240s\250#\250Q"; -static const char __pyx_k_77RRS_4q_4q_AYm1_t_AYa[] = "\320\004$\320$7\3207R\320RS\330\010\013\2104\210q\330\014\023\2204\220q\230\004\320\034,\250A\250Y\260m\3001\330\010\017\210t\320\023$\240A\240Y\250a"; -static const char __pyx_k_Solver_getSolutionIter[] = "Solver.getSolutionIter"; -static const char __pyx_k_constraint_constraints[] = "constraint.constraints"; -static const char __pyx_k_list_dict_Hashable_any[] = "list[dict[Hashable, any]]"; -static const char __pyx_k_is_valid_locals_genexpr[] = "is_valid..genexpr"; -static const char __pyx_k_BacktrackingSolver___init[] = "BacktrackingSolver.__init__"; -static const char __pyx_k_MinConflictsSolver___init[] = "MinConflictsSolver.__init__"; -static const char __pyx_k_doesn_t_provide_iteration[] = " doesn't provide iteration"; -static const char __pyx_k_iq_b_A_c_jPTT_a_5_Q_q_c_E[] = "\320\004*\320*>\270i\300q\360\026\000\t\017\210b\220\001\220\023\220A\220\\\240\021\240,\250c\260\021\260'\270\021\270,\300j\320PT\320T`\320`a\330\010\013\2105\220\001\220\024\220Q\330\010\017\210q\220\002\220$\220c\230\023\230E\240\021"; -static const char __pyx_k_ParallelSolver_getSolution[] = "ParallelSolver.getSolution"; -static const char __pyx_k_OptimizedBacktrackingSolver[] = "OptimizedBacktrackingSolver"; -static const char __pyx_k_ParallelSolver_getSolutions[] = "ParallelSolver.getSolutions"; -static const char __pyx_k_RecursiveBacktrackingSolver[] = "RecursiveBacktrackingSolver"; -static const char __pyx_k_only_provides_all_solutions[] = " only provides all solutions"; -static const char __pyx_k_CompilableFunctionConstraint[] = "CompilableFunctionConstraint"; -static const char __pyx_k_BacktrackingSolver_getSolution[] = "BacktrackingSolver.getSolution"; -static const char __pyx_k_MinConflictsSolver_getSolution[] = "MinConflictsSolver.getSolution"; -static const char __pyx_k_N_O_E_E_F_P_qPUUaaeeffkkoosszz[] = "\320\004(\320(N\360\000\000O\001E\002\360\000\000E\002F\002\360\006\000\tP\001\310q\320PU\320Ua\320ae\320ef\320fk\320ko\320os\320sz\320z{\360\006\000\t'\240f\250A\250W\260E\270\024\270T\300\021\360\006\000\t\025\220K\230q\240\001\330\010\031\230\033\240A\240Q\360\006\000\t\022\220\021\330\010/\250q\360\006\000\t\031\320\030/\250t\3203G\300q\330\r\032\230&\240\001\340\014\026\220h\230d\240!\320#4\260F\270*\300A\330\014\020\220\n\230!\330\020\031\230\027\240\001\240\021\340\010\017\210q"; -static const char __pyx_k_UUn_o_Z_Z_P_P_Q_t1_q_q_1__Cq_1[] = "\320\000/\320/U\320Un\360\000\000o\001Z\002\360\000\000Z\002P\003\360\000\000P\003Q\003\340\004\007\200t\2101\330\010\017\210q\220\n\230%\230q\340\004\n\210/\230\022\2301\330\004\025\220_\240C\240q\340\004+\2501\330\004\010\210\t\220\027\230\001\230\021\330\010\022\220!\2207\230!\330\010\013\2108\2201\220L\320 1\260\021\260&\270\001\330\014\025\220W\230A\320\035;\2701\270L\320HX\320Xa\320ab\330\010\014\210J\220a\220q\330\004\013\2101"; -static const char __pyx_k_list_tuple_Constraint_Hashable[] = "list[tuple[Constraint, Hashable]]"; -static const char __pyx_k_sequential_optimized_backtrack[] = "sequential_optimized_backtrack"; -static const char __pyx_k_sequential_recursive_backtrack[] = "sequential_recursive_backtrack"; -static const char __pyx_k_39A_D_1_e81_9G5_9Cq_t1A_Q_S_a_1[] = "\320\000\021\220\037\320 3\2609\270A\360\n\000\005\r\210D\220\t\230\021\230)\2401\330\004\n\210!\330\010\022\220$\220e\2308\2401\330\010\013\2109\220G\2305\240\003\2409\250C\250q\330\014\r\330\010\021\220\027\230\001\230\021\330\010\027\220t\2301\230A\330\010\014\320\014\035\230Q\330\014\035\230\\\250\021\250!\330\014\017\210~\230S\240\001\330\020\036\230a\230{\250!\2501\340\020\036\230g\240Q\240a\330\014\017\210q\340\020\024\220I\230V\2401\330\024\037\230q\240\014\250A\330\024\027\220q\330\030\034\230N\250!\330\034'\240q\320(9\270\021\330\034 \240\014\250M\270\021\330 #\2404\240z\260\021\260+\270Y\300m\320ST\330$%\360\006\000!\"\360\006\000\035#\240*\250A\250Q\340\030\034\230K\240q\250\001\330\020\024\220K\230q\240\001\360\006\000\r\020\210t\2201\330\020\027\220q\330\004\013\2101"; -static const char __pyx_k_66QQR_V_d_fL_G7_F_a_L_q_F_7_1_E[] = "\320\004#\320#6\3206Q\320QR\330\010\021\220\024\220V\230;\240d\250'\260\027\270\n\300&\310\001\330\010\022\220$\220f\230L\250\004\250G\2607\270*\300F\310!\330\010\026\220a\340\010\014\210L\230\001\330\014\027\220q\230\014\240F\250!\2507\260!\2601\330\010\014\210E\220\025\220a\220t\2301\330\014\031\230\021\330\014\022\220$\220a\220w\230e\2401\330\014\023\2201\220A\330\014\020\220\014\230A\340\020\024\220L\240\r\250\\\270\021\270!\330\024\027\220t\230:\240Q\240k\260\031\270!\330\030\031\340\024\025\340\020\033\2303\230a\230|\2501\250A\330\020\034\230A\330\020\024\220I\230W\240A\240Q\330\024\037\230q\240\014\250A\330\024\034\230A\330\024\030\230\014\240M\260\034\270Q\270a\330\030\033\2304\230z\250\021\250+\260Y\270a\330\034%\240Q\330\024\027\220v\230S\240\001\330\030!\240\027\250\001\250\021\330\031\037\230r\240\021\330\030#\2401\330\030\034\230I\240Q\330\030!\240\027\250\001\250\021\340\020\033\2301\230L\250\006\250a\250q\330\020\035\230Q\330\014\017\210t\2201\330\020\027\220q\330\010\017\210q"; -static const char __pyx_k_8_1_Q_L_3a_Q_1_1Ks_Qk_G1A_1Ks_Q[] = "\320\000\025\320\025(\320(8\270\001\360\n\000\005\014\2101\330\004\010\210\005\210Q\330\010\024\220L\240\001\330\010\013\2103\210a\210{\230#\230Q\330\014\027\220|\2401\330\014\020\220\013\2301\230K\240s\250+\260Q\260k\300\023\300G\3101\310A\330\014\020\220\013\2301\230K\240s\250+\260Q\260k\300\023\300G\3101\310A\330\004\013\2101"; -static const char __pyx_k_Abstract_base_class_for_solvers[] = "Abstract base class for solvers."; -static const char __pyx_k_BacktrackingSolver_getSolutions[] = "BacktrackingSolver.getSolutions"; -static const char __pyx_k_N_O_E_E_F_A_Q_A_4_2_9A_A_9G1_WA[] = "\320\004(\320(N\360\000\000O\001E\002\360\000\000E\002F\002\360\030\000\t\035\230A\330\010\035\230Q\330\010$\240A\330\010\033\2304\320\0372\260!\2609\270A\340\010\t\340\014\020\220\014\230A\330\020\023\2209\230G\2401\340\024\035\230W\240A\240Y\250a\330\024\025\360\010\000\021\032\230\027\240\001\240\033\250E\260\021\330\020\023\2204\220q\330\024\033\2301\330\020\032\230)\2405\250\004\250A\340\014\r\340\020\023\2204\220q\340\024\030\230\013\2401\240A\330\024\032\230!\330\030\"\240)\2505\260\004\260A\330\030\033\2301\330\034\035\330\030\034\230K\240q\250\001\340\030\037\230q\360\006\000\021\034\2301\230L\250\006\250d\260!\330\020\024\220L\240\r\250\\\270\021\270!\330\024\027\220t\230:\240Q\240k\260\031\270-\300q\340\030\031\340\024\025\360\006\000\r\022\220\027\230\002\230*\240A"; -static const char __pyx_k_ParallelSolver_getSolutionsList[] = "ParallelSolver.getSolutionsList..genexpr"; -static const char __pyx_k_UUn_o_Z_Z_P_P_Q_q_L_y_q_WA_Q_t1[] = "\320\000/\320/U\320Un\360\000\000o\001Z\002\360\000\000Z\002P\003\360\000\000P\003Q\003\360\010\000\005\023\220!\330\004\027\220q\330\004\031\230\021\330\004 \240\001\340\004\005\340\010\014\210L\230\001\330\014\017\210y\230\007\230q\340\020\031\230\027\240\001\240\031\250!\330\020\021\360\010\000\r\026\220W\230A\230[\250\005\250Q\330\014\017\210t\2201\330\020\027\220q\330\014\026\220i\230u\240D\250\001\340\010\t\340\014\017\210t\2201\340\020\024\220K\230q\240\001\330\020\026\220a\330\024\036\230i\240u\250D\260\001\330\024\027\220q\330\030\031\330\024\030\230\013\2401\240A\340\024\033\2301\360\006\000\r\030\220q\230\014\240F\250$\250a\330\014\020\220\014\230M\320):\270!\2701\330\020\023\2204\220z\240\021\240+\250Y\260m\3001\340\024\025\340\020\021\360\006\000\t\016\210W\220B\220j\240\001"; -static const char __pyx_k_U_U_V_k_FWWX_1_q_E_1_q_QgQe1A_P[] = "\320\000\032\360\000\000\033U\002\360\000\000U\002V\002\340\004\022\220)\320\033.\250k\270\035\320FW\320WX\330\004\030\230\013\2401\340\004\007\200q\340\010\014\210E\220\037\320 1\260\026\260q\330\014\035\230Q\230g\240Q\240e\2501\250A\320-@\300\001\300\037\320PZ\320Z[\320[g\360\000\000h\001K\002\360\000\000K\002W\002\360\000\000W\002^\002\360\000\000^\002b\002\360\000\000b\002n\002\360\000\000n\002v\002\360\000\000v\002w\002\360\006\000\005\010\200x\210q\320\020\"\320\"3\2601\260L\300\001\330\010\017\320\017-\250Q\320.@\320@P\320PY\320YZ\330\004\013\2101"; -static const char __pyx_k_provides_only_a_single_solution[] = " provides only a single solution"; -static const char __pyx_k_tuple_bool_dict_Hashable_Domain[] = "tuple[bool, dict[Hashable, Domain], dict[Hashable, list[tuple[Constraint, Hashable]]], Hashable, any, list[Hashable]]"; -static const char __pyx_k_A_b_A_c_jPTT_a_5_Q_HA_t2S_q_WA_Q[] = "\200A\360\032\000\t\017\210b\220\001\220\023\220A\220\\\240\021\240,\250c\260\021\260'\270\021\270,\300j\320PT\320T`\320`a\330\010\013\2105\220\001\220\024\220Q\330\010\014\210H\220A\330\014\017\210t\2202\220S\230\007\230q\340\020\021\360\006\000\r\026\220W\230A\230[\250\005\250Q\330\014\023\2201\340\010\023\2204\220r\230\021\330\010\023\2201\220L\240\001\340\010\027\220t\2301\330\010\013\2101\330\014\032\230!\2307\240!\2403\240d\250%\250x\260s\270\"\270G\3001\340\014\032\230!\340\010\014\210I\220W\230A\230Q\330\014\027\220q\230\014\240A\330\014\017\210q\330\020\024\220J\230a\330\024\032\230*\240A\330\014\020\220\014\230M\250\034\260Q\260a\330\020\023\2204\220z\240\021\240+\250Y\260m\3001\340\024\025\360\006\000\021\025\320\024*\250!\250;\260i\270~\310]\320Z[\330\020\023\220:\230T\240\021\330\024\033\2301\330\014\017\210q\330\020\024\220J\230a\330\024\032\230)\2401\330\010\014\210K\220q\230\001\330\010\017\210q"; -static const char __pyx_k_BacktrackingSolver_getSolutionIt[] = "BacktrackingSolver.getSolutionIter"; static const char __pyx_k_Module_containing_the_code_for_t[] = "Module containing the code for the problem solvers."; -static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; -static const char __pyx_k_OptimizedBacktrackingSolver___in[] = "OptimizedBacktrackingSolver.__init__"; -static const char __pyx_k_OptimizedBacktrackingSolver_getS[] = "OptimizedBacktrackingSolver.getSolutionIter"; -static const char __pyx_k_Problem_solver_based_on_the_mini[] = "Problem solver based on the minimum conflicts theory.\n\n Examples:\n >>> result = [[('a', 1), ('b', 2)],\n ... [('a', 1), ('b', 3)],\n ... [('a', 2), ('b', 3)]]\n\n >>> problem = Problem(MinConflictsSolver())\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(lambda a, b: b > a, [\"a\", \"b\"])\n\n >>> solution = problem.getSolution()\n >>> sorted(solution.items()) in result\n True\n\n >>> problem.getSolutions()\n Traceback (most recent call last):\n ...\n NotImplementedError: MinConflictsSolver provides only a single solution\n\n >>> problem.getSolutionIter()\n Traceback (most recent call last):\n ...\n NotImplementedError: MinConflictsSolver doesn't provide iteration\n "; -static const char __pyx_k_Problem_solver_that_executes_all[] = "Problem solver that executes all-solution solve in parallel (ProcessPool or ThreadPool mode).\n\n Sorts the domains on size, creating jobs for each value in the domain with the most variables.\n Each leaf job is solved locally with either optimized backtracking or recursion.\n Whether this is actually faster than non-parallel solving depends on your problem, and hardware and software environment. \n\n Uses ThreadPool by default. Instantiate with process_mode=True to use ProcessPool. \n In ProcessPool mode, the jobs do not share memory.\n In ProcessPool mode, precompiled FunctionConstraints are not allowed due to pickling, use string constraints instead.\n\n Examples:\n >>> result = [[('a', 1), ('b', 2)],\n ... [('a', 1), ('b', 3)],\n ... [('a', 2), ('b', 3)]]\n\n >>> problem = Problem(ParallelSolver())\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(\"b > a\", [\"a\", \"b\"])\n\n >>> for solution in problem.getSolutions():\n ... sorted(solution.items()) in result\n True\n True\n True\n\n >>> problem.getSolution()\n Traceback (most recent call last):\n ...\n NotImplementedError: ParallelSolver only provides all solutions\n\n >>> problem.getSolutionIter()\n Traceback (most recent call last):\n ...\n NotImplementedError: ParallelSolver doesn't provide iteration\n "; -static const char __pyx_k_Problem_solver_with_backtracking[] = "Problem solver with backtracking capabilities.\n\n Examples:\n >>> result = [[('a', 1), ('b', 2)],\n ... [('a', 1), ('b', 3)],\n ... [('a', 2), ('b', 3)]]\n\n >>> problem = Problem(BacktrackingSolver())\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(lambda a, b: b > a, [\"a\", \"b\"])\n\n >>> solution = problem.getSolution()\n >>> sorted(solution.items()) in result\n True\n\n >>> for solution in problem.getSolutionIter():\n ... sorted(solution.items()) in result\n True\n True\n True\n\n >>> for solution in problem.getSolutions():\n ... sorted(solution.items()) in result\n True\n True\n True\n "; -static const char __pyx_k_RecursiveBacktrackingSolver___in[] = "RecursiveBacktrackingSolver.__init__"; -static const char __pyx_k_RecursiveBacktrackingSolver_getS[] = "RecursiveBacktrackingSolver.getSolution"; -static const char __pyx_k_RecursiveBacktrackingSolver_recu[] = "RecursiveBacktrackingSolver.recursiveBacktracking.."; -static const char __pyx_k_Recursive_problem_solver_with_ba[] = "Recursive problem solver with backtracking capabilities.\n\n Examples:\n >>> result = [[('a', 1), ('b', 2)],\n ... [('a', 1), ('b', 3)],\n ... [('a', 2), ('b', 3)]]\n\n >>> problem = Problem(RecursiveBacktrackingSolver())\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(lambda a, b: b > a, [\"a\", \"b\"])\n\n >>> solution = problem.getSolution()\n >>> sorted(solution.items()) in result\n True\n\n >>> for solution in problem.getSolutions():\n ... sorted(solution.items()) in result\n True\n True\n True\n\n >>> problem.getSolutionIter()\n Traceback (most recent call last):\n ...\n NotImplementedError: RecursiveBacktrackingSolver doesn't provide iteration\n "; -static const char __pyx_k_dict_Hashable_list_tuple_Constra[] = "dict[Hashable, list[tuple[Constraint, Hashable]]]"; -static const char __pyx_k_is_valid_locals_genexpr_locals_g[] = "is_valid..genexpr..genexpr"; -static const char __pyx_k_ParallelSolver_getSolutionsList_2[] = "ParallelSolver.getSolutionsList.."; -static const char __pyx_k_ParallelSolver_getSolutionsList_3[] = "ParallelSolver.getSolutionsList"; -static const char __pyx_k_BacktrackingSolver_getSolutionIt_2[] = "BacktrackingSolver.getSolutionIter.."; -static const char __pyx_k_OptimizedBacktrackingSolver_getS_2[] = "OptimizedBacktrackingSolver.getSortedVariables.."; -static const char __pyx_k_OptimizedBacktrackingSolver_getS_3[] = "OptimizedBacktrackingSolver.getSolutionsList"; -static const char __pyx_k_OptimizedBacktrackingSolver_getS_4[] = "OptimizedBacktrackingSolver.getSolutions"; -static const char __pyx_k_OptimizedBacktrackingSolver_getS_5[] = "OptimizedBacktrackingSolver.getSolution"; -static const char __pyx_k_OptimizedBacktrackingSolver_getS_6[] = "OptimizedBacktrackingSolver.getSortedVariables"; -static const char __pyx_k_Problem_solver_with_backtracking_2[] = "Problem solver with backtracking capabilities, implementing several optimizations for increased performance.\n\n Optimizations are especially in obtaining all solutions.\n View https://github.com/python-constraint/python-constraint/pull/76 for more details.\n\n Examples:\n >>> result = [[('a', 1), ('b', 2)],\n ... [('a', 1), ('b', 3)],\n ... [('a', 2), ('b', 3)]]\n\n >>> problem = Problem(OptimizedBacktrackingSolver())\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(lambda a, b: b > a, [\"a\", \"b\"])\n\n >>> solution = problem.getSolution()\n >>> sorted(solution.items()) in result\n True\n\n >>> for solution in problem.getSolutionIter():\n ... sorted(solution.items()) in result\n True\n True\n True\n\n >>> for solution in problem.getSolutions():\n ... sorted(solution.items()) in result\n True\n True\n True\n "; -static const char __pyx_k_RecursiveBacktrackingSolver_getS_2[] = "RecursiveBacktrackingSolver.getSolutions"; -static const char __pyx_k_RecursiveBacktrackingSolver_recu_2[] = "RecursiveBacktrackingSolver.recursiveBacktracking"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints); /* proto */ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arcs, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments); /* proto */ @@ -3136,24 +3005,6 @@ typedef struct { PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED - PyTypeObject *__pyx_CyFunctionType; - #endif - #ifdef __Pyx_FusedFunction_USED - PyTypeObject *__pyx_FusedFunctionType; - #endif - #ifdef __Pyx_Generator_USED - PyTypeObject *__pyx_GeneratorType; - #endif - #ifdef __Pyx_IterableCoroutine_USED - PyTypeObject *__pyx_IterableCoroutineType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineAwaitType; - #endif - #ifdef __Pyx_Coroutine_USED - PyTypeObject *__pyx_CoroutineType; - #endif PyObject *__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter; PyObject *__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter; PyObject *__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList; @@ -3169,17 +3020,17 @@ typedef struct { PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr; PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values; __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop; __Pyx_CachedCFunction __pyx_umethod_PyList_Type__copy; PyObject *__pyx_slice[1]; PyObject *__pyx_tuple[4]; PyObject *__pyx_codeobj_tab[37]; - PyObject *__pyx_string_tab[219]; - PyObject *__pyx_int_0; - PyObject *__pyx_int_1; - PyObject *__pyx_int_1000; + PyObject *__pyx_string_tab[245]; + PyObject *__pyx_number_tab[3]; /* #### Code section: module_state_contents ### */ /* CommonTypesMetaclass.module_state_decls */ PyTypeObject *__pyx_CommonTypesMetaclassType; @@ -3189,6 +3040,9 @@ PyTypeObject *__pyx_CommonTypesMetaclassType; PyObject *__Pyx_CachedMethodType; #endif +/* CythonFunctionShared.module_state_decls */ +PyTypeObject *__pyx_CyFunctionType; + /* IterNextPlain.module_state_decls */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; @@ -3232,6 +3086,9 @@ int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr; /* CodeObjectCache.module_state_decls */ struct __Pyx_CodeObjectCache __pyx_code_cache; +/* Generator.module_state_decls */ +PyTypeObject *__pyx_GeneratorType; + /* #### Code section: module_state_end ### */ } __pyx_mstatetype; @@ -3259,173 +3116,173 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati /* #### Code section: constant_name_defines ### */ #define __pyx_kp_u_ __pyx_string_tab[0] #define __pyx_kp_u_Abstract_base_class_for_solvers __pyx_string_tab[1] -#define __pyx_n_u_BacktrackingSolver __pyx_string_tab[2] -#define __pyx_n_u_BacktrackingSolver___init __pyx_string_tab[3] -#define __pyx_n_u_BacktrackingSolver_getSolution __pyx_string_tab[4] -#define __pyx_n_u_BacktrackingSolver_getSolutionIt __pyx_string_tab[5] -#define __pyx_n_u_BacktrackingSolver_getSolutionIt_2 __pyx_string_tab[6] -#define __pyx_n_u_BacktrackingSolver_getSolutions __pyx_string_tab[7] -#define __pyx_kp_u_Can_t_happen __pyx_string_tab[8] -#define __pyx_n_u_CompilableFunctionConstraint __pyx_string_tab[9] -#define __pyx_n_u_Constraint __pyx_string_tab[10] -#define __pyx_n_u_Domain __pyx_string_tab[11] -#define __pyx_n_u_FunctionConstraint __pyx_string_tab[12] -#define __pyx_n_u_FunctionType __pyx_string_tab[13] -#define __pyx_n_u_Hashable __pyx_string_tab[14] -#define __pyx_n_u_MinConflictsSolver __pyx_string_tab[15] -#define __pyx_n_u_MinConflictsSolver___init __pyx_string_tab[16] -#define __pyx_n_u_MinConflictsSolver_getSolution __pyx_string_tab[17] -#define __pyx_n_u_NotImplementedError __pyx_string_tab[18] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[19] -#define __pyx_n_u_OptimizedBacktrackingSolver __pyx_string_tab[20] -#define __pyx_n_u_OptimizedBacktrackingSolver___in __pyx_string_tab[21] -#define __pyx_n_u_OptimizedBacktrackingSolver_getS __pyx_string_tab[22] -#define __pyx_n_u_OptimizedBacktrackingSolver_getS_2 __pyx_string_tab[23] -#define __pyx_n_u_OptimizedBacktrackingSolver_getS_3 __pyx_string_tab[24] -#define __pyx_n_u_OptimizedBacktrackingSolver_getS_4 __pyx_string_tab[25] -#define __pyx_n_u_OptimizedBacktrackingSolver_getS_5 __pyx_string_tab[26] -#define __pyx_n_u_OptimizedBacktrackingSolver_getS_6 __pyx_string_tab[27] -#define __pyx_n_u_ParallelSolver __pyx_string_tab[28] -#define __pyx_n_u_ParallelSolver___init __pyx_string_tab[29] -#define __pyx_n_u_ParallelSolver_getSolution __pyx_string_tab[30] -#define __pyx_n_u_ParallelSolver_getSolutions __pyx_string_tab[31] -#define __pyx_n_u_ParallelSolver_getSolutionsList __pyx_string_tab[32] -#define __pyx_n_u_ParallelSolver_getSolutionsList_2 __pyx_string_tab[33] -#define __pyx_n_u_ParallelSolver_getSolutionsList_3 __pyx_string_tab[34] -#define __pyx_kp_u_Problem_solver_based_on_the_mini __pyx_string_tab[35] -#define __pyx_kp_u_Problem_solver_that_executes_all __pyx_string_tab[36] -#define __pyx_kp_u_Problem_solver_with_backtracking __pyx_string_tab[37] -#define __pyx_kp_u_Problem_solver_with_backtracking_2 __pyx_string_tab[38] -#define __pyx_n_u_ProcessPoolExecutor __pyx_string_tab[39] -#define __pyx_n_u_RecursiveBacktrackingSolver __pyx_string_tab[40] -#define __pyx_n_u_RecursiveBacktrackingSolver___in __pyx_string_tab[41] -#define __pyx_n_u_RecursiveBacktrackingSolver_getS __pyx_string_tab[42] -#define __pyx_n_u_RecursiveBacktrackingSolver_getS_2 __pyx_string_tab[43] -#define __pyx_n_u_RecursiveBacktrackingSolver_recu __pyx_string_tab[44] -#define __pyx_n_u_RecursiveBacktrackingSolver_recu_2 __pyx_string_tab[45] -#define __pyx_kp_u_Recursive_problem_solver_with_ba __pyx_string_tab[46] -#define __pyx_n_u_RuntimeError __pyx_string_tab[47] -#define __pyx_n_u_Solver __pyx_string_tab[48] -#define __pyx_n_u_Solver_getSolution __pyx_string_tab[49] -#define __pyx_n_u_Solver_getSolutionIter __pyx_string_tab[50] -#define __pyx_n_u_Solver_getSolutions __pyx_string_tab[51] -#define __pyx_n_u_StopIteration __pyx_string_tab[52] -#define __pyx_n_u_ThreadPoolExecutor __pyx_string_tab[53] -#define __pyx_kp_u__2 __pyx_string_tab[54] -#define __pyx_n_u__5 __pyx_string_tab[55] -#define __pyx_kp_u_add_note __pyx_string_tab[56] -#define __pyx_n_u_append __pyx_string_tab[57] -#define __pyx_n_u_arcconstraints __pyx_string_tab[58] -#define __pyx_n_u_arcs __pyx_string_tab[59] -#define __pyx_n_u_arcsvariable __pyx_string_tab[60] -#define __pyx_n_u_args __pyx_string_tab[61] -#define __pyx_n_u_assignment __pyx_string_tab[62] -#define __pyx_n_u_assignments __pyx_string_tab[63] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[64] -#define __pyx_n_u_bool __pyx_string_tab[65] -#define __pyx_n_u_c __pyx_string_tab[66] -#define __pyx_n_u_check __pyx_string_tab[67] -#define __pyx_n_u_choice __pyx_string_tab[68] -#define __pyx_n_u_chunksize __pyx_string_tab[69] -#define __pyx_n_u_class __pyx_string_tab[70] -#define __pyx_n_u_class_getitem __pyx_string_tab[71] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[72] -#define __pyx_n_u_close __pyx_string_tab[73] -#define __pyx_n_u_co_consts __pyx_string_tab[74] -#define __pyx_n_u_code_object __pyx_string_tab[75] -#define __pyx_n_u_collections_abc __pyx_string_tab[76] -#define __pyx_n_u_compile __pyx_string_tab[77] -#define __pyx_n_u_compile_to_function __pyx_string_tab[78] -#define __pyx_n_u_concurrent_futures __pyx_string_tab[79] -#define __pyx_n_u_conflicted __pyx_string_tab[80] -#define __pyx_n_u_constraint __pyx_string_tab[81] -#define __pyx_n_u_constraint_constraints __pyx_string_tab[82] -#define __pyx_n_u_constraint_domain __pyx_string_tab[83] -#define __pyx_n_u_constraint_lookup __pyx_string_tab[84] -#define __pyx_n_u_constraint_solvers __pyx_string_tab[85] -#define __pyx_kp_u_constraint_solvers_py __pyx_string_tab[86] -#define __pyx_n_u_constraints __pyx_string_tab[87] -#define __pyx_n_u_constraints_lookup __pyx_string_tab[88] -#define __pyx_n_u_copy __pyx_string_tab[89] -#define __pyx_n_u_count __pyx_string_tab[90] -#define __pyx_n_u_dict __pyx_string_tab[91] -#define __pyx_kp_u_dict_Hashable_Domain __pyx_string_tab[92] -#define __pyx_kp_u_dict_Hashable_any __pyx_string_tab[93] -#define __pyx_kp_u_dict_Hashable_list_tuple_Constra __pyx_string_tab[94] -#define __pyx_kp_u_disable __pyx_string_tab[95] -#define __pyx_n_u_doArc8 __pyx_string_tab[96] -#define __pyx_n_u_doc __pyx_string_tab[97] -#define __pyx_kp_u_doesn_t_provide_iteration __pyx_string_tab[98] -#define __pyx_n_u_domain __pyx_string_tab[99] -#define __pyx_n_u_domains __pyx_string_tab[100] -#define __pyx_kp_u_enable __pyx_string_tab[101] -#define __pyx_n_u_enter __pyx_string_tab[102] -#define __pyx_n_u_exec __pyx_string_tab[103] -#define __pyx_n_u_executor __pyx_string_tab[104] -#define __pyx_n_u_exit __pyx_string_tab[105] -#define __pyx_n_u_first_value __pyx_string_tab[106] -#define __pyx_n_u_first_var __pyx_string_tab[107] -#define __pyx_n_u_forwardcheck __pyx_string_tab[108] -#define __pyx_n_u_forwardcheck_2 __pyx_string_tab[109] -#define __pyx_n_u_fromkeys __pyx_string_tab[110] -#define __pyx_n_u_func __pyx_string_tab[111] -#define __pyx_n_u_func_2 __pyx_string_tab[112] -#define __pyx_n_u_func_3 __pyx_string_tab[113] -#define __pyx_n_u_func_string __pyx_string_tab[114] -#define __pyx_kp_u_gc __pyx_string_tab[115] -#define __pyx_n_u_genexpr __pyx_string_tab[116] -#define __pyx_n_u_get __pyx_string_tab[117] -#define __pyx_n_u_getArcs __pyx_string_tab[118] -#define __pyx_n_u_getSolution __pyx_string_tab[119] -#define __pyx_n_u_getSolutionIter __pyx_string_tab[120] -#define __pyx_n_u_getSolutions __pyx_string_tab[121] -#define __pyx_n_u_getSolutionsList __pyx_string_tab[122] -#define __pyx_n_u_getSortedVariables __pyx_string_tab[123] -#define __pyx_n_u_hideValue __pyx_string_tab[124] -#define __pyx_n_u_init __pyx_string_tab[125] -#define __pyx_n_u_initializing __pyx_string_tab[126] -#define __pyx_kp_u_is_an_abstract_class __pyx_string_tab[127] -#define __pyx_n_u_is_coroutine __pyx_string_tab[128] -#define __pyx_n_u_is_valid __pyx_string_tab[129] -#define __pyx_n_u_is_valid_locals_genexpr __pyx_string_tab[130] -#define __pyx_n_u_is_valid_locals_genexpr_locals_g __pyx_string_tab[131] -#define __pyx_kp_u_isenabled __pyx_string_tab[132] -#define __pyx_n_u_item __pyx_string_tab[133] -#define __pyx_n_u_items __pyx_string_tab[134] -#define __pyx_n_u_iter __pyx_string_tab[135] -#define __pyx_n_u_key __pyx_string_tab[136] -#define __pyx_n_u_keys __pyx_string_tab[137] -#define __pyx_n_u_lambda __pyx_string_tab[138] -#define __pyx_n_u_list __pyx_string_tab[139] -#define __pyx_kp_u_list_Hashable __pyx_string_tab[140] -#define __pyx_kp_u_list_dict_Hashable_any __pyx_string_tab[141] -#define __pyx_kp_u_list_tuple __pyx_string_tab[142] -#define __pyx_kp_u_list_tuple_Constraint_Hashable __pyx_string_tab[143] -#define __pyx_n_u_local_assignment __pyx_string_tab[144] -#define __pyx_n_u_lst __pyx_string_tab[145] -#define __pyx_n_u_main __pyx_string_tab[146] -#define __pyx_n_u_map __pyx_string_tab[147] -#define __pyx_n_u_metaclass __pyx_string_tab[148] -#define __pyx_n_u_mincount __pyx_string_tab[149] -#define __pyx_n_u_minvalues __pyx_string_tab[150] -#define __pyx_n_u_module __pyx_string_tab[151] -#define __pyx_n_u_mro_entries __pyx_string_tab[152] -#define __pyx_n_u_msg __pyx_string_tab[153] -#define __pyx_n_u_name __pyx_string_tab[154] -#define __pyx_n_u_next __pyx_string_tab[155] -#define __pyx_kp_u_only_provides_all_solutions __pyx_string_tab[156] -#define __pyx_n_u_otherdomain __pyx_string_tab[157] -#define __pyx_n_u_othervalue __pyx_string_tab[158] -#define __pyx_n_u_othervariable __pyx_string_tab[159] -#define __pyx_n_u_parallel_pool __pyx_string_tab[160] -#define __pyx_n_u_parallel_worker __pyx_string_tab[161] -#define __pyx_n_u_pop __pyx_string_tab[162] -#define __pyx_n_u_popState __pyx_string_tab[163] -#define __pyx_n_u_popitem __pyx_string_tab[164] -#define __pyx_n_u_prepare __pyx_string_tab[165] -#define __pyx_n_u_process_mode __pyx_string_tab[166] -#define __pyx_n_u_process_mode_2 __pyx_string_tab[167] -#define __pyx_kp_u_provides_only_a_single_solution __pyx_string_tab[168] +#define __pyx_kp_u_Can_t_happen __pyx_string_tab[2] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[3] +#define __pyx_kp_u_Problem_solver_based_on_the_mini __pyx_string_tab[4] +#define __pyx_kp_u_Problem_solver_that_executes_all __pyx_string_tab[5] +#define __pyx_kp_u_Problem_solver_with_backtracking __pyx_string_tab[6] +#define __pyx_kp_u_Problem_solver_with_backtracking_2 __pyx_string_tab[7] +#define __pyx_kp_u_Recursive_problem_solver_with_ba __pyx_string_tab[8] +#define __pyx_kp_u__2 __pyx_string_tab[9] +#define __pyx_kp_u_add_note __pyx_string_tab[10] +#define __pyx_kp_u_constraint_solvers_py __pyx_string_tab[11] +#define __pyx_kp_u_dict_Hashable_Domain __pyx_string_tab[12] +#define __pyx_kp_u_dict_Hashable_any __pyx_string_tab[13] +#define __pyx_kp_u_dict_Hashable_list_tuple_Constra __pyx_string_tab[14] +#define __pyx_kp_u_disable __pyx_string_tab[15] +#define __pyx_kp_u_doesn_t_provide_iteration __pyx_string_tab[16] +#define __pyx_kp_u_enable __pyx_string_tab[17] +#define __pyx_kp_u_gc __pyx_string_tab[18] +#define __pyx_kp_u_is_an_abstract_class __pyx_string_tab[19] +#define __pyx_kp_u_isenabled __pyx_string_tab[20] +#define __pyx_kp_u_list_Hashable __pyx_string_tab[21] +#define __pyx_kp_u_list_dict_Hashable_any __pyx_string_tab[22] +#define __pyx_kp_u_list_tuple __pyx_string_tab[23] +#define __pyx_kp_u_list_tuple_Constraint_Hashable __pyx_string_tab[24] +#define __pyx_kp_u_only_provides_all_solutions __pyx_string_tab[25] +#define __pyx_kp_u_provides_only_a_single_solution __pyx_string_tab[26] +#define __pyx_kp_u_string __pyx_string_tab[27] +#define __pyx_kp_u_tuple_bool_dict_Hashable_Domain __pyx_string_tab[28] +#define __pyx_n_u_BacktrackingSolver __pyx_string_tab[29] +#define __pyx_n_u_BacktrackingSolver___init __pyx_string_tab[30] +#define __pyx_n_u_BacktrackingSolver_getSolution __pyx_string_tab[31] +#define __pyx_n_u_BacktrackingSolver_getSolutionIt __pyx_string_tab[32] +#define __pyx_n_u_BacktrackingSolver_getSolutionIt_2 __pyx_string_tab[33] +#define __pyx_n_u_BacktrackingSolver_getSolutions __pyx_string_tab[34] +#define __pyx_n_u_CompilableFunctionConstraint __pyx_string_tab[35] +#define __pyx_n_u_Constraint __pyx_string_tab[36] +#define __pyx_n_u_Domain __pyx_string_tab[37] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[38] +#define __pyx_n_u_FunctionType __pyx_string_tab[39] +#define __pyx_n_u_Hashable __pyx_string_tab[40] +#define __pyx_n_u_MinConflictsSolver __pyx_string_tab[41] +#define __pyx_n_u_MinConflictsSolver___init __pyx_string_tab[42] +#define __pyx_n_u_MinConflictsSolver_getSolution __pyx_string_tab[43] +#define __pyx_n_u_OptimizedBacktrackingSolver __pyx_string_tab[44] +#define __pyx_n_u_OptimizedBacktrackingSolver___in __pyx_string_tab[45] +#define __pyx_n_u_OptimizedBacktrackingSolver_getS __pyx_string_tab[46] +#define __pyx_n_u_OptimizedBacktrackingSolver_getS_2 __pyx_string_tab[47] +#define __pyx_n_u_OptimizedBacktrackingSolver_getS_3 __pyx_string_tab[48] +#define __pyx_n_u_OptimizedBacktrackingSolver_getS_4 __pyx_string_tab[49] +#define __pyx_n_u_OptimizedBacktrackingSolver_getS_5 __pyx_string_tab[50] +#define __pyx_n_u_OptimizedBacktrackingSolver_getS_6 __pyx_string_tab[51] +#define __pyx_n_u_ParallelSolver __pyx_string_tab[52] +#define __pyx_n_u_ParallelSolver___init __pyx_string_tab[53] +#define __pyx_n_u_ParallelSolver_getSolution __pyx_string_tab[54] +#define __pyx_n_u_ParallelSolver_getSolutions __pyx_string_tab[55] +#define __pyx_n_u_ParallelSolver_getSolutionsList __pyx_string_tab[56] +#define __pyx_n_u_ParallelSolver_getSolutionsList_2 __pyx_string_tab[57] +#define __pyx_n_u_ParallelSolver_getSolutionsList_3 __pyx_string_tab[58] +#define __pyx_n_u_ProcessPoolExecutor __pyx_string_tab[59] +#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[60] +#define __pyx_n_u_RecursiveBacktrackingSolver __pyx_string_tab[61] +#define __pyx_n_u_RecursiveBacktrackingSolver___in __pyx_string_tab[62] +#define __pyx_n_u_RecursiveBacktrackingSolver_getS __pyx_string_tab[63] +#define __pyx_n_u_RecursiveBacktrackingSolver_getS_2 __pyx_string_tab[64] +#define __pyx_n_u_RecursiveBacktrackingSolver_recu __pyx_string_tab[65] +#define __pyx_n_u_RecursiveBacktrackingSolver_recu_2 __pyx_string_tab[66] +#define __pyx_n_u_Solver __pyx_string_tab[67] +#define __pyx_n_u_Solver_getSolution __pyx_string_tab[68] +#define __pyx_n_u_Solver_getSolutionIter __pyx_string_tab[69] +#define __pyx_n_u_Solver_getSolutions __pyx_string_tab[70] +#define __pyx_n_u_ThreadPoolExecutor __pyx_string_tab[71] +#define __pyx_n_u__5 __pyx_string_tab[72] +#define __pyx_n_u_annotate __pyx_string_tab[73] +#define __pyx_n_u_append __pyx_string_tab[74] +#define __pyx_n_u_arcconstraints __pyx_string_tab[75] +#define __pyx_n_u_arcs __pyx_string_tab[76] +#define __pyx_n_u_arcsvariable __pyx_string_tab[77] +#define __pyx_n_u_args __pyx_string_tab[78] +#define __pyx_n_u_assignment __pyx_string_tab[79] +#define __pyx_n_u_assignments __pyx_string_tab[80] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[81] +#define __pyx_n_u_bool __pyx_string_tab[82] +#define __pyx_n_u_c __pyx_string_tab[83] +#define __pyx_n_u_check __pyx_string_tab[84] +#define __pyx_n_u_choice __pyx_string_tab[85] +#define __pyx_n_u_chunksize __pyx_string_tab[86] +#define __pyx_n_u_class __pyx_string_tab[87] +#define __pyx_n_u_class_getitem __pyx_string_tab[88] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[89] +#define __pyx_n_u_close __pyx_string_tab[90] +#define __pyx_n_u_co_consts __pyx_string_tab[91] +#define __pyx_n_u_code_object __pyx_string_tab[92] +#define __pyx_n_u_collections_abc __pyx_string_tab[93] +#define __pyx_n_u_compile __pyx_string_tab[94] +#define __pyx_n_u_compile_to_function __pyx_string_tab[95] +#define __pyx_n_u_concurrent_futures __pyx_string_tab[96] +#define __pyx_n_u_conflicted __pyx_string_tab[97] +#define __pyx_n_u_constraint __pyx_string_tab[98] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[99] +#define __pyx_n_u_constraint_domain __pyx_string_tab[100] +#define __pyx_n_u_constraint_lookup __pyx_string_tab[101] +#define __pyx_n_u_constraint_solvers __pyx_string_tab[102] +#define __pyx_n_u_constraints __pyx_string_tab[103] +#define __pyx_n_u_constraints_lookup __pyx_string_tab[104] +#define __pyx_n_u_copy __pyx_string_tab[105] +#define __pyx_n_u_count __pyx_string_tab[106] +#define __pyx_n_u_dict __pyx_string_tab[107] +#define __pyx_n_u_doArc8 __pyx_string_tab[108] +#define __pyx_n_u_doc __pyx_string_tab[109] +#define __pyx_n_u_domain __pyx_string_tab[110] +#define __pyx_n_u_domains __pyx_string_tab[111] +#define __pyx_n_u_enter __pyx_string_tab[112] +#define __pyx_n_u_exec __pyx_string_tab[113] +#define __pyx_n_u_executor __pyx_string_tab[114] +#define __pyx_n_u_exit __pyx_string_tab[115] +#define __pyx_n_u_first_value __pyx_string_tab[116] +#define __pyx_n_u_first_var __pyx_string_tab[117] +#define __pyx_n_u_forwardcheck __pyx_string_tab[118] +#define __pyx_n_u_forwardcheck_2 __pyx_string_tab[119] +#define __pyx_n_u_fromkeys __pyx_string_tab[120] +#define __pyx_n_u_func __pyx_string_tab[121] +#define __pyx_n_u_func_2 __pyx_string_tab[122] +#define __pyx_n_u_func_3 __pyx_string_tab[123] +#define __pyx_n_u_func_string __pyx_string_tab[124] +#define __pyx_n_u_genexpr __pyx_string_tab[125] +#define __pyx_n_u_get __pyx_string_tab[126] +#define __pyx_n_u_getArcs __pyx_string_tab[127] +#define __pyx_n_u_getSolution __pyx_string_tab[128] +#define __pyx_n_u_getSolutionIter __pyx_string_tab[129] +#define __pyx_n_u_getSolutions __pyx_string_tab[130] +#define __pyx_n_u_getSolutionsList __pyx_string_tab[131] +#define __pyx_n_u_getSortedVariables __pyx_string_tab[132] +#define __pyx_n_u_hideValue __pyx_string_tab[133] +#define __pyx_n_u_init __pyx_string_tab[134] +#define __pyx_n_u_is_coroutine __pyx_string_tab[135] +#define __pyx_n_u_is_valid __pyx_string_tab[136] +#define __pyx_n_u_is_valid_locals_genexpr __pyx_string_tab[137] +#define __pyx_n_u_is_valid_locals_genexpr_locals_g __pyx_string_tab[138] +#define __pyx_n_u_item __pyx_string_tab[139] +#define __pyx_n_u_items __pyx_string_tab[140] +#define __pyx_n_u_iter __pyx_string_tab[141] +#define __pyx_n_u_key __pyx_string_tab[142] +#define __pyx_n_u_keys __pyx_string_tab[143] +#define __pyx_n_u_lambda __pyx_string_tab[144] +#define __pyx_n_u_list __pyx_string_tab[145] +#define __pyx_n_u_local_assignment __pyx_string_tab[146] +#define __pyx_n_u_lst __pyx_string_tab[147] +#define __pyx_n_u_main __pyx_string_tab[148] +#define __pyx_n_u_map __pyx_string_tab[149] +#define __pyx_n_u_metaclass __pyx_string_tab[150] +#define __pyx_n_u_mincount __pyx_string_tab[151] +#define __pyx_n_u_minvalues __pyx_string_tab[152] +#define __pyx_n_u_module __pyx_string_tab[153] +#define __pyx_n_u_mro_entries __pyx_string_tab[154] +#define __pyx_n_u_msg __pyx_string_tab[155] +#define __pyx_n_u_name __pyx_string_tab[156] +#define __pyx_n_u_next __pyx_string_tab[157] +#define __pyx_n_u_otherdomain __pyx_string_tab[158] +#define __pyx_n_u_othervalue __pyx_string_tab[159] +#define __pyx_n_u_othervariable __pyx_string_tab[160] +#define __pyx_n_u_parallel_pool __pyx_string_tab[161] +#define __pyx_n_u_parallel_worker __pyx_string_tab[162] +#define __pyx_n_u_pop __pyx_string_tab[163] +#define __pyx_n_u_popState __pyx_string_tab[164] +#define __pyx_n_u_popitem __pyx_string_tab[165] +#define __pyx_n_u_prepare __pyx_string_tab[166] +#define __pyx_n_u_process_mode __pyx_string_tab[167] +#define __pyx_n_u_process_mode_2 __pyx_string_tab[168] #define __pyx_n_u_pushState __pyx_string_tab[169] #define __pyx_n_u_pushdomains __pyx_string_tab[170] #define __pyx_n_u_qualname __pyx_string_tab[171] @@ -3433,49 +3290,78 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_rand __pyx_string_tab[173] #define __pyx_n_u_rand_2 __pyx_string_tab[174] #define __pyx_n_u_random __pyx_string_tab[175] -#define __pyx_n_u_range __pyx_string_tab[176] -#define __pyx_n_u_recursiveBacktracking __pyx_string_tab[177] -#define __pyx_n_u_remaining_vars __pyx_string_tab[178] -#define __pyx_n_u_requires_pickling __pyx_string_tab[179] -#define __pyx_n_u_result __pyx_string_tab[180] -#define __pyx_n_u_results __pyx_string_tab[181] -#define __pyx_n_u_return __pyx_string_tab[182] -#define __pyx_n_u_self __pyx_string_tab[183] -#define __pyx_n_u_send __pyx_string_tab[184] -#define __pyx_n_u_sequential_optimized_backtrack __pyx_string_tab[185] -#define __pyx_n_u_sequential_recursive_backtrack __pyx_string_tab[186] -#define __pyx_n_u_set_name __pyx_string_tab[187] -#define __pyx_n_u_setdefault __pyx_string_tab[188] -#define __pyx_n_u_shuffle __pyx_string_tab[189] -#define __pyx_n_u_single __pyx_string_tab[190] -#define __pyx_n_u_solutions __pyx_string_tab[191] -#define __pyx_n_u_sort __pyx_string_tab[192] -#define __pyx_n_u_sorted __pyx_string_tab[193] -#define __pyx_n_u_sorted_variables __pyx_string_tab[194] -#define __pyx_n_u_sorted_vars __pyx_string_tab[195] -#define __pyx_n_u_spec __pyx_string_tab[196] -#define __pyx_n_u_steps __pyx_string_tab[197] -#define __pyx_n_u_steps_2 __pyx_string_tab[198] -#define __pyx_kp_u_string __pyx_string_tab[199] -#define __pyx_n_u_super __pyx_string_tab[200] -#define __pyx_n_u_test __pyx_string_tab[201] -#define __pyx_n_u_throw __pyx_string_tab[202] -#define __pyx_kp_u_tuple_bool_dict_Hashable_Domain __pyx_string_tab[203] -#define __pyx_n_u_types __pyx_string_tab[204] -#define __pyx_n_u_unassigned_vars __pyx_string_tab[205] -#define __pyx_n_u_v __pyx_string_tab[206] -#define __pyx_n_u_val __pyx_string_tab[207] -#define __pyx_n_u_vals __pyx_string_tab[208] -#define __pyx_n_u_value __pyx_string_tab[209] -#define __pyx_n_u_values __pyx_string_tab[210] -#define __pyx_n_u_var __pyx_string_tab[211] -#define __pyx_n_u_variable __pyx_string_tab[212] -#define __pyx_n_u_variable1 __pyx_string_tab[213] -#define __pyx_n_u_variable2 __pyx_string_tab[214] -#define __pyx_n_u_variables __pyx_string_tab[215] -#define __pyx_n_u_vars_involved __pyx_string_tab[216] -#define __pyx_n_u_vconstraints __pyx_string_tab[217] -#define __pyx_n_u_x __pyx_string_tab[218] +#define __pyx_n_u_recursiveBacktracking __pyx_string_tab[176] +#define __pyx_n_u_remaining_vars __pyx_string_tab[177] +#define __pyx_n_u_requires_pickling __pyx_string_tab[178] +#define __pyx_n_u_result __pyx_string_tab[179] +#define __pyx_n_u_results __pyx_string_tab[180] +#define __pyx_n_u_return __pyx_string_tab[181] +#define __pyx_n_u_self __pyx_string_tab[182] +#define __pyx_n_u_send __pyx_string_tab[183] +#define __pyx_n_u_sequential_optimized_backtrack __pyx_string_tab[184] +#define __pyx_n_u_sequential_recursive_backtrack __pyx_string_tab[185] +#define __pyx_n_u_set_name __pyx_string_tab[186] +#define __pyx_n_u_setdefault __pyx_string_tab[187] +#define __pyx_n_u_shuffle __pyx_string_tab[188] +#define __pyx_n_u_single __pyx_string_tab[189] +#define __pyx_n_u_solutions __pyx_string_tab[190] +#define __pyx_n_u_sort __pyx_string_tab[191] +#define __pyx_n_u_sorted __pyx_string_tab[192] +#define __pyx_n_u_sorted_variables __pyx_string_tab[193] +#define __pyx_n_u_sorted_vars __pyx_string_tab[194] +#define __pyx_n_u_steps __pyx_string_tab[195] +#define __pyx_n_u_steps_2 __pyx_string_tab[196] +#define __pyx_n_u_super __pyx_string_tab[197] +#define __pyx_n_u_test __pyx_string_tab[198] +#define __pyx_n_u_throw __pyx_string_tab[199] +#define __pyx_n_u_types __pyx_string_tab[200] +#define __pyx_n_u_unassigned_vars __pyx_string_tab[201] +#define __pyx_n_u_v __pyx_string_tab[202] +#define __pyx_n_u_val __pyx_string_tab[203] +#define __pyx_n_u_vals __pyx_string_tab[204] +#define __pyx_n_u_value __pyx_string_tab[205] +#define __pyx_n_u_values __pyx_string_tab[206] +#define __pyx_n_u_var __pyx_string_tab[207] +#define __pyx_n_u_variable __pyx_string_tab[208] +#define __pyx_n_u_variable1 __pyx_string_tab[209] +#define __pyx_n_u_variable2 __pyx_string_tab[210] +#define __pyx_n_u_variables __pyx_string_tab[211] +#define __pyx_n_u_vars_involved __pyx_string_tab[212] +#define __pyx_n_u_vconstraints __pyx_string_tab[213] +#define __pyx_n_u_x __pyx_string_tab[214] +#define __pyx_kp_b_iso88591_1_Ja_IQ __pyx_string_tab[215] +#define __pyx_kp_b_iso88591_39A_D_1_e81_9G5_9Cq_t1A_Q_S_a_1 __pyx_string_tab[216] +#define __pyx_kp_b_iso88591_3awVWWX __pyx_string_tab[217] +#define __pyx_kp_b_iso88591_66QQR_D_at9N_a_z_Yas_Q __pyx_string_tab[218] +#define __pyx_kp_b_iso88591_66QQR_V_d_fL_G7_F_a_L_q_F_7_1_E __pyx_string_tab[219] +#define __pyx_kp_b_iso88591_66QQR_b_Zq __pyx_string_tab[220] +#define __pyx_kp_b_iso88591_66QQR_t_1I_4q_1 __pyx_string_tab[221] +#define __pyx_kp_b_iso88591_77RRS_4q_4q_AYm1_t_AYa __pyx_string_tab[222] +#define __pyx_kp_b_iso88591_77RRS_b_Zq __pyx_string_tab[223] +#define __pyx_kp_b_iso88591_77RRS_t1D_q __pyx_string_tab[224] +#define __pyx_kp_b_iso88591_77RRS_t_AYa __pyx_string_tab[225] +#define __pyx_kp_b_iso88591_77RRS_t_i_T __pyx_string_tab[226] +#define __pyx_kp_b_iso88591_8_1_Q_L_3a_Q_1_1Ks_Qk_G1A_1Ks_Q __pyx_string_tab[227] +#define __pyx_kp_b_iso88591_AQd_1A __pyx_string_tab[228] +#define __pyx_kp_b_iso88591_A_b_A_c_jPTT_a_5_Q_HA_t2S_q_WA_Q __pyx_string_tab[229] +#define __pyx_kp_b_iso88591_BBn_o_J_J_K __pyx_string_tab[230] +#define __pyx_kp_b_iso88591_EQ_A_1_q_Qd_Qa __pyx_string_tab[231] +#define __pyx_kp_b_iso88591_N_O_E_E_F_A_Q_A_4_2_9A_A_9G1_WA __pyx_string_tab[232] +#define __pyx_kp_b_iso88591_N_O_E_E_F_P_qPUUaaeeffkkoosszz __pyx_string_tab[233] +#define __pyx_kp_b_iso88591_UUV __pyx_string_tab[234] +#define __pyx_kp_b_iso88591_UUV_b_Zq __pyx_string_tab[235] +#define __pyx_kp_b_iso88591_UUn_o_Z_Z_P_P_Q_q_L_y_q_WA_Q_t1 __pyx_string_tab[236] +#define __pyx_kp_b_iso88591_UUn_o_Z_Z_P_P_Q_t1_q_q_1__Cq_1 __pyx_string_tab[237] +#define __pyx_kp_b_iso88591_U_U_V_k_FWWX_1_q_E_1_q_QgQe1A_P __pyx_string_tab[238] +#define __pyx_kp_b_iso88591__3 __pyx_string_tab[239] +#define __pyx_kp_b_iso88591__4 __pyx_string_tab[240] +#define __pyx_kp_b_iso88591_aq __pyx_string_tab[241] +#define __pyx_kp_b_iso88591_iq_b_A_c_jPTT_a_5_Q_q_c_E __pyx_string_tab[242] +#define __pyx_kp_b_iso88591_q_Q __pyx_string_tab[243] +#define __pyx_kp_b_iso88591_q_Ry_Q __pyx_string_tab[244] +#define __pyx_int_0 __pyx_number_tab[0] +#define __pyx_int_1 __pyx_number_tab[1] +#define __pyx_int_1000 __pyx_number_tab[2] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -3487,12 +3373,6 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif #if CYTHON_PEP489_MULTI_PHASE_INIT __Pyx_State_RemoveModule(NULL); #endif @@ -3513,11 +3393,20 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } for (int i=0; i<37; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<219; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } - Py_CLEAR(clear_module_state->__pyx_int_0); - Py_CLEAR(clear_module_state->__pyx_int_1); - Py_CLEAR(clear_module_state->__pyx_int_1000); - return 0; + for (int i=0; i<245; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); } +/* #### Code section: module_state_clear_contents ### */ +/* CommonTypesMetaclass.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType); + +/* CythonFunctionShared.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + +/* Generator.module_state_clear */ +Py_CLEAR(clear_module_state->__pyx_GeneratorType); + +/* #### Code section: module_state_clear_end ### */ +return 0; } #endif /* #### Code section: module_state_traverse ### */ @@ -3531,12 +3420,6 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); - #endif Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter); Py_VISIT(traverse_module_state->__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter); @@ -3554,11 +3437,20 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } for (int i=0; i<37; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<219; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); - __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1000); - return 0; + for (int i=0; i<245; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); } +/* #### Code section: module_state_traverse_contents ### */ +/* CommonTypesMetaclass.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType); + +/* CythonFunctionShared.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + +/* Generator.module_state_traverse */ +Py_VISIT(traverse_module_state->__pyx_GeneratorType); + +/* #### Code section: module_state_traverse_end ### */ +return 0; } #endif /* #### Code section: module_code ### */ @@ -3612,7 +3504,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 13, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 13, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: @@ -3627,7 +3519,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getArcs", 0) < 0) __PYX_ERR(0, 13, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getArcs", 0) < (0)) __PYX_ERR(0, 13, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 2; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getArcs", 1, 2, 2, i); __PYX_ERR(0, 13, __pyx_L3_error) } } @@ -3730,7 +3622,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -3759,10 +3651,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); } @@ -3781,7 +3673,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < (0)) __PYX_ERR(0, 20, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L6_unpacking_done; @@ -3830,10 +3722,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } @@ -3852,7 +3744,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < (0)) __PYX_ERR(0, 22, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L9_unpacking_done; @@ -3877,7 +3769,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * */ __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyDict_SetDefault(__pyx_v_arcs, __pyx_v_variable1, __pyx_t_5, -1L); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_SetDefault(__pyx_v_arcs, __pyx_v_variable1, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __pyx_t_9; @@ -3887,7 +3779,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * __pyx_t_10 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_variable2, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setdefault, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -3906,7 +3798,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * */ __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyDict_SetDefault(__pyx_v_arcs, __pyx_v_variable2, __pyx_t_5, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_SetDefault(__pyx_v_arcs, __pyx_v_variable2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = __pyx_t_4; @@ -3916,7 +3808,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * __pyx_t_10 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_variable1, __pyx_t_5}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setdefault, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -4036,7 +3928,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_arcs,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 28, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 28, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: @@ -4055,7 +3947,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "doArc8", 0) < 0) __PYX_ERR(0, 28, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "doArc8", 0) < (0)) __PYX_ERR(0, 28, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("doArc8", 1, 3, 3, i); __PYX_ERR(0, 28, __pyx_L3_error) } } @@ -4160,7 +4052,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * __pyx_t_3 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_domains, Py_True}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_fromkeys, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fromkeys, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -4191,7 +4083,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_popitem, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_popitem, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -4211,10 +4103,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_5); } @@ -4235,7 +4127,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < (0)) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_unpacking_done; @@ -4337,7 +4229,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * #endif if (__pyx_t_9 >= __pyx_temp) break; } - __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_9); + __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_9; } else { { @@ -4473,7 +4365,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * #endif if (__pyx_t_11 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_11); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_5, __pyx_t_11, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_11; } else { { @@ -4551,7 +4443,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * #endif if (__pyx_t_13 >= __pyx_temp) break; } - __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_13; } else { { @@ -4619,7 +4511,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * #endif if (__pyx_t_15 >= __pyx_temp) break; } - __pyx_t_17 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_15); + __pyx_t_17 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_6, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_15; } else { { @@ -4664,10 +4556,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * __pyx_t_19 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_19); } else { - __pyx_t_18 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_18 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_18); - __pyx_t_19 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_19 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_19); } @@ -4688,7 +4580,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * __Pyx_GOTREF(__pyx_t_18); index = 1; __pyx_t_19 = __pyx_t_7(__pyx_t_20); if (unlikely(!__pyx_t_19)) goto __pyx_L21_unpacking_failed; __Pyx_GOTREF(__pyx_t_19); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_20), 2) < 0) __PYX_ERR(0, 53, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_20), 2) < (0)) __PYX_ERR(0, 53, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; goto __pyx_L22_unpacking_done; @@ -4728,7 +4620,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * #endif { PyObject *__pyx_callargs[5] = {__pyx_t_19, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, Py_True}; - __pyx_t_17 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_17 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 54, __pyx_L1_error) @@ -4812,7 +4704,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_value}; - __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hideValue, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -5013,7 +4905,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 77, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 77, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -5036,7 +4928,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < 0) __PYX_ERR(0, 77, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < (0)) __PYX_ERR(0, 77, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, i); __PYX_ERR(0, 77, __pyx_L3_error) } } @@ -5098,8 +4990,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_getSolution(CYTHON_UNUSE __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; + size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5120,7 +5011,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_getSolution(CYTHON_UNUSE __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_is_an_abstract_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_is_an_abstract_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); @@ -5134,14 +5025,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_getSolution(CYTHON_UNUSE * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): */ __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_NotImplementedError); - __pyx_t_3 = __pyx_builtin_NotImplementedError; - __pyx_t_4 = 1; + __pyx_t_3 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_msg}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } @@ -5161,7 +5049,6 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_getSolution(CYTHON_UNUSE __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.solvers.Solver.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XDECREF(__pyx_v_msg); @@ -5221,7 +5108,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 89, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 89, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -5244,7 +5131,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutions", 0) < 0) __PYX_ERR(0, 89, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutions", 0) < (0)) __PYX_ERR(0, 89, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, i); __PYX_ERR(0, 89, __pyx_L3_error) } } @@ -5306,8 +5193,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_2getSolutions(CYTHON_UNU __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; + size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5328,7 +5214,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_2getSolutions(CYTHON_UNU __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_provides_only_a_single_solution); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_provides_only_a_single_solution); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); @@ -5342,14 +5228,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_2getSolutions(CYTHON_UNU * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): */ __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_NotImplementedError); - __pyx_t_3 = __pyx_builtin_NotImplementedError; - __pyx_t_4 = 1; + __pyx_t_3 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_msg}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } @@ -5369,7 +5252,6 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_2getSolutions(CYTHON_UNU __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.solvers.Solver.getSolutions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XDECREF(__pyx_v_msg); @@ -5429,7 +5311,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 101, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 101, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -5452,7 +5334,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionIter", 0) < 0) __PYX_ERR(0, 101, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionIter", 0) < (0)) __PYX_ERR(0, 101, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 4, 4, i); __PYX_ERR(0, 101, __pyx_L3_error) } } @@ -5514,8 +5396,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(CYTHON_ __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; + size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5536,7 +5417,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(CYTHON_ __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_doesn_t_provide_iteration); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_doesn_t_provide_iteration); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); @@ -5550,14 +5431,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(CYTHON_ * */ __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_NotImplementedError); - __pyx_t_3 = __pyx_builtin_NotImplementedError; - __pyx_t_4 = 1; + __pyx_t_3 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_msg}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } @@ -5577,7 +5455,6 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(CYTHON_ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.solvers.Solver.getSolutionIter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XDECREF(__pyx_v_msg); @@ -5635,7 +5512,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 143, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 143, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: @@ -5650,7 +5527,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 143, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 143, __pyx_L3_error) if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(0, 143, __pyx_L3_error) } @@ -5710,7 +5587,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver___init__(CY * * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2, __pyx_v_forwardcheck) < 0) __PYX_ERR(0, 151, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2, __pyx_v_forwardcheck) < (0)) __PYX_ERR(0, 151, __pyx_L1_error) /* "constraint/solvers.py":143 * """ @@ -5783,7 +5660,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 153, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 153, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -5806,7 +5683,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionIter", 0) < 0) __PYX_ERR(0, 153, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionIter", 0) < (0)) __PYX_ERR(0, 153, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 4, 4, i); __PYX_ERR(0, 153, __pyx_L3_error) } } @@ -5909,7 +5786,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 162, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 162, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: @@ -5920,7 +5797,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lambda", 0) < 0) __PYX_ERR(0, 162, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lambda", 0) < (0)) __PYX_ERR(0, 162, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("lambda", 1, 1, 1, i); __PYX_ERR(0, 162, __pyx_L3_error) } } @@ -5966,9 +5843,9 @@ static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -6208,8 +6085,8 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL}; __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_key, __pyx_t_10, __pyx_t_9, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 162, __pyx_L1_error) - __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_sort, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_key, __pyx_t_10, __pyx_t_9, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_sort, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -6235,7 +6112,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -6251,7 +6128,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * # Found unassigned variable * variable = item[-1] */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = (__Pyx_PyDict_ContainsTF(__pyx_t_9, __pyx_cur_scope->__pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -6264,7 +6141,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * values = domains[variable][:] * if forwardcheck: */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_variable); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_9); @@ -6434,8 +6311,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * return * variable, values, pushdomains = queue.pop() */ - __pyx_t_12 = (__Pyx_PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_12 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_12 = (__pyx_temp != 0); + } + __pyx_t_13 = (!__pyx_t_12); if (__pyx_t_13) { @@ -6485,13 +6366,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 2); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } @@ -6516,7 +6397,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __Pyx_GOTREF(__pyx_t_9); index = 2; __pyx_t_2 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L21_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 3) < 0) __PYX_ERR(0, 179, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 3) < (0)) __PYX_ERR(0, 179, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L22_unpacking_done; @@ -6576,7 +6457,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -6623,7 +6504,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; - __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -6688,8 +6569,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: */ while (1) { - __pyx_t_12 = (__Pyx_PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_12 < 0))) __PYX_ERR(0, 189, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_12 = (__pyx_temp != 0); + } + if (!__pyx_t_12) break; /* "constraint/solvers.py":190 @@ -6718,13 +6603,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_10); } else { - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 2); + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_10); } @@ -6749,7 +6634,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __Pyx_GOTREF(__pyx_t_9); index = 2; __pyx_t_10 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_10)) goto __pyx_L32_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 3) < 0) __PYX_ERR(0, 190, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 3) < (0)) __PYX_ERR(0, 190, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L33_unpacking_done; @@ -6809,7 +6694,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -6856,7 +6741,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; - __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); @@ -6991,7 +6876,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -7038,7 +6923,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; - __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_pushState, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_10 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_pushState, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); @@ -7093,7 +6978,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_4); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -7138,10 +7023,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } @@ -7162,7 +7047,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L45_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 2) < 0) __PYX_ERR(0, 207, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 2) < (0)) __PYX_ERR(0, 207, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L46_unpacking_done; @@ -7206,7 +7091,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( #endif { PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_variables, __pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_pushdomains}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_11, (5-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_11, (5-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) @@ -7298,7 +7183,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_4); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -7345,7 +7230,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __pyx_t_11 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7403,14 +7288,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_RuntimeError); - __pyx_t_9 = __pyx_builtin_RuntimeError; __pyx_t_11 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Can_t_happen}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); } @@ -7499,7 +7381,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 223, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 223, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -7522,7 +7404,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < 0) __PYX_ERR(0, 223, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < (0)) __PYX_ERR(0, 223, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, i); __PYX_ERR(0, 223, __pyx_L3_error) } } @@ -7606,7 +7488,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio __pyx_t_3 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7663,7 +7545,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * return None * */ - __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_StopIteration)))); if (__pyx_t_7) { __Pyx_ErrRestore(0,0,0); @@ -7778,7 +7660,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 230, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 230, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -7801,7 +7683,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutions", 0) < 0) __PYX_ERR(0, 230, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutions", 0) < (0)) __PYX_ERR(0, 230, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, i); __PYX_ERR(0, 230, __pyx_L3_error) } } @@ -7881,7 +7763,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_7getSolutio __pyx_t_3 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7962,7 +7844,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 266, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 266, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: @@ -7977,7 +7859,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 266, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 266, __pyx_L3_error) if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(0, 266, __pyx_L3_error) } @@ -8037,7 +7919,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver___ * * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2, __pyx_v_forwardcheck) < 0) __PYX_ERR(0, 274, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2, __pyx_v_forwardcheck) < (0)) __PYX_ERR(0, 274, __pyx_L1_error) /* "constraint/solvers.py":266 * """ @@ -8110,7 +7992,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 276, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 276, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -8133,7 +8015,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionIter", 0) < 0) __PYX_ERR(0, 276, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionIter", 0) < (0)) __PYX_ERR(0, 276, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 4, 4, i); __PYX_ERR(0, 276, __pyx_L3_error) } } @@ -8310,7 +8192,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_3 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_getSortedVariables, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSortedVariables, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8367,7 +8249,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -8575,8 +8457,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * return * variable, values, pushdomains = queue.pop() */ - __pyx_t_6 = (__Pyx_PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 298, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_6 = (__pyx_temp != 0); + } + __pyx_t_13 = (!__pyx_t_6); if (__pyx_t_13) { @@ -8626,13 +8512,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_11); } else { - __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 2); + __pyx_t_11 = __Pyx_PyList_GET_ITEM_REF(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_11); } @@ -8657,7 +8543,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_11 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_11)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 3) < 0) __PYX_ERR(0, 300, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 3) < (0)) __PYX_ERR(0, 300, __pyx_L1_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L20_unpacking_done; @@ -8717,7 +8603,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_11 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_11 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -8764,7 +8650,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_11 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); @@ -8829,8 +8715,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: */ while (1) { - __pyx_t_6 = (__Pyx_PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 310, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_6 = (__pyx_temp != 0); + } + if (!__pyx_t_6) break; /* "constraint/solvers.py":311 @@ -8859,13 +8749,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_11 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_11); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 2); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); } @@ -8890,7 +8780,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_7 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_7)) goto __pyx_L30_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 3) < 0) __PYX_ERR(0, 311, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 3) < (0)) __PYX_ERR(0, 311, __pyx_L1_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L31_unpacking_done; @@ -8950,7 +8840,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -8997,7 +8887,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); @@ -9132,7 +9022,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -9179,7 +9069,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_pushState, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_pushState, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); @@ -9234,7 +9124,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_4); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -9279,10 +9169,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_11); } else { - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_11 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_11); } @@ -9303,7 +9193,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_11 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_11)) goto __pyx_L43_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 328, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 328, __pyx_L1_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L44_unpacking_done; @@ -9347,7 +9237,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g #endif { PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_variables, __pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_pushdomains}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) @@ -9439,7 +9329,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_4); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -9486,7 +9376,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -9544,14 +9434,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 */ __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_RuntimeError); - __pyx_t_2 = __pyx_builtin_RuntimeError; __pyx_t_3 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Can_t_happen}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } @@ -9640,7 +9527,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 344, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 344, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: @@ -9659,7 +9546,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionsList", 0) < 0) __PYX_ERR(0, 344, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionsList", 0) < (0)) __PYX_ERR(0, 344, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutionsList", 1, 3, 3, i); __PYX_ERR(0, 344, __pyx_L3_error) } } @@ -9787,7 +9674,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __pyx_t_3 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_domains, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_getSortedVariables, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSortedVariables, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -9830,7 +9717,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -9941,8 +9828,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * return solutions * variable, values = queue.pop() */ - __pyx_t_6 = (__Pyx_PyList_GET_SIZE(__pyx_v_queue) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 372, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_queue); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_6 = (__pyx_temp != 0); + } + __pyx_t_9 = (!__pyx_t_6); if (__pyx_t_9) { @@ -9991,10 +9882,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); } @@ -10015,7 +9906,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 374, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 374, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L12_unpacking_done; @@ -10070,8 +9961,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if values: */ while (1) { - __pyx_t_6 = (__Pyx_PyList_GET_SIZE(__pyx_v_queue) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 381, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_queue); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 381, __pyx_L1_error) + __pyx_t_6 = (__pyx_temp != 0); + } + if (!__pyx_t_6) break; /* "constraint/solvers.py":382 @@ -10098,10 +9993,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_7); } @@ -10122,7 +10017,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L18_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 382, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 382, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L19_unpacking_done; @@ -10241,7 +10136,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_4); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { @@ -10286,10 +10181,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_10); } else { - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_10); } @@ -10310,7 +10205,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L23_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_12), 2) < 0) __PYX_ERR(0, 391, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_12), 2) < (0)) __PYX_ERR(0, 391, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L24_unpacking_done; @@ -10350,7 +10245,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g #endif { PyObject *__pyx_callargs[5] = {__pyx_t_10, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, Py_None}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) @@ -10510,7 +10405,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 401, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 401, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -10533,7 +10428,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutions", 0) < 0) __PYX_ERR(0, 401, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutions", 0) < (0)) __PYX_ERR(0, 401, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, i); __PYX_ERR(0, 401, __pyx_L3_error) } } @@ -10627,7 +10522,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g __pyx_t_4 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -10661,7 +10556,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g __pyx_t_4 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_domains, __pyx_v_vconstraints}; - __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_getSolutionsList, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolutionsList, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -10740,7 +10635,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 406, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 406, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -10763,7 +10658,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < 0) __PYX_ERR(0, 406, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < (0)) __PYX_ERR(0, 406, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, i); __PYX_ERR(0, 406, __pyx_L3_error) } } @@ -10847,7 +10742,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g __pyx_t_3 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -10904,7 +10799,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * return None * */ - __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_StopIteration)))); if (__pyx_t_7) { __Pyx_ErrRestore(0,0,0); @@ -11019,7 +10914,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 413, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 413, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: @@ -11038,7 +10933,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSortedVariables", 0) < 0) __PYX_ERR(0, 413, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSortedVariables", 0) < (0)) __PYX_ERR(0, 413, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSortedVariables", 1, 3, 3, i); __PYX_ERR(0, 413, __pyx_L3_error) } } @@ -11137,7 +11032,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 425, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 425, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: @@ -11148,7 +11043,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lambda1", 0) < 0) __PYX_ERR(0, 425, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lambda1", 0) < (0)) __PYX_ERR(0, 425, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("lambda1", 1, 1, 1, i); __PYX_ERR(0, 425, __pyx_L3_error) } } @@ -11194,9 +11089,9 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda1", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -11333,8 +11228,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL}; __pyx_t_9 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_key, __pyx_t_10, __pyx_t_9, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 425, __pyx_L1_error) - __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_sort, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_key, __pyx_t_10, __pyx_t_9, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_sort, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_9); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -11364,7 +11259,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_4); + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_9, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 426, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); @@ -11385,13 +11280,13 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_12); } else { - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L11_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L11_error) __Pyx_XGOTREF(__pyx_t_6); - __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 2); + __pyx_t_12 = __Pyx_PyList_GET_ITEM_REF(sequence, 2, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L11_error) __Pyx_XGOTREF(__pyx_t_12); } @@ -11416,7 +11311,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 __Pyx_GOTREF(__pyx_t_6); index = 2; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < 0) __PYX_ERR(0, 426, __pyx_L11_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < (0)) __PYX_ERR(0, 426, __pyx_L11_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L15_unpacking_done; @@ -11527,7 +11422,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 456, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 456, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: @@ -11542,7 +11437,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 456, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 456, __pyx_L3_error) if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True))); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(0, 456, __pyx_L3_error) } @@ -11602,7 +11497,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver___ * * def recursiveBacktracking(self, solutions, domains, vconstraints, assignments, single): */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2, __pyx_v_forwardcheck) < 0) __PYX_ERR(0, 464, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2, __pyx_v_forwardcheck) < (0)) __PYX_ERR(0, 464, __pyx_L1_error) /* "constraint/solvers.py":456 * """ @@ -11677,7 +11572,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_solutions,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_vconstraints,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_single,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 466, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 466, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 6: @@ -11708,7 +11603,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "recursiveBacktracking", 0) < 0) __PYX_ERR(0, 466, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "recursiveBacktracking", 0) < (0)) __PYX_ERR(0, 466, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 6; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("recursiveBacktracking", 1, 6, 6, i); __PYX_ERR(0, 466, __pyx_L3_error) } } @@ -11805,7 +11700,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 480, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 480, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: @@ -11816,7 +11711,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lambda2", 0) < 0) __PYX_ERR(0, 480, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lambda2", 0) < (0)) __PYX_ERR(0, 480, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("lambda2", 1, 1, 1, i); __PYX_ERR(0, 480, __pyx_L3_error) } } @@ -11862,9 +11757,9 @@ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda2", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -11962,7 +11857,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -12047,8 +11942,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL}; __pyx_t_7 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_key, __pyx_t_8, __pyx_t_7, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 480, __pyx_L1_error) - __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_sort, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_key, __pyx_t_8, __pyx_t_7, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_sort, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -12074,7 +11969,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); @@ -12088,7 +11983,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * # Found an unassigned variable. Let's go. * break */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_7, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -12140,7 +12035,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -12169,7 +12064,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * assignments[variable] = None * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_variable = __pyx_t_1; __pyx_t_1 = 0; @@ -12234,7 +12129,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -12337,7 +12232,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_3 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_3); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_7, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_3; } else { { @@ -12386,8 +12281,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for domain in pushdomains: * domain.pushState() */ - __pyx_t_10 = (__pyx_v_pushdomains != Py_None)&&(__Pyx_PyList_GET_SIZE(__pyx_v_pushdomains) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_10 < 0))) __PYX_ERR(0, 501, __pyx_L1_error) + if (__pyx_v_pushdomains == Py_None) __pyx_t_10 = 0; + else + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_pushdomains); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_10 = (__pyx_temp != 0); + } + if (__pyx_t_10) { /* "constraint/solvers.py":502 @@ -12411,7 +12312,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -12430,7 +12331,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_pushState, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_pushState, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -12485,7 +12386,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_6); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; } else { { @@ -12530,10 +12431,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_5); } @@ -12554,7 +12455,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_5 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_5)) goto __pyx_L32_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) __PYX_ERR(0, 504, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < (0)) __PYX_ERR(0, 504, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L33_unpacking_done; @@ -12594,7 +12495,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif { PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_pushdomains}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_9, (5-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (5-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) @@ -12651,7 +12552,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r __pyx_t_9 = 0; { PyObject *__pyx_callargs[6] = {__pyx_t_1, __pyx_v_solutions, __pyx_v_domains, __pyx_v_vconstraints, __pyx_v_assignments, __pyx_v_single}; - __pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_recursiveBacktracking, __pyx_callargs+__pyx_t_9, (6-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_recursiveBacktracking, __pyx_callargs+__pyx_t_9, (6-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -12707,9 +12608,15 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for domain in pushdomains: * domain.popState() */ - __pyx_t_15 = (__pyx_v_pushdomains != Py_None)&&(__Pyx_PyList_GET_SIZE(__pyx_v_pushdomains) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_15 < 0))) __PYX_ERR(0, 513, __pyx_L1_error) - if (__pyx_t_15) { + if (__pyx_v_pushdomains == Py_None) __pyx_t_15 = 0; + else + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_pushdomains); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_15 = (__pyx_temp != 0); + } + + if (__pyx_t_15) { /* "constraint/solvers.py":514 * return solutions @@ -12732,7 +12639,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r #endif if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_6); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_6; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -12751,7 +12658,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_popState, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -12893,7 +12800,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 519, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 519, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -12916,7 +12823,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < 0) __PYX_ERR(0, 519, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < (0)) __PYX_ERR(0, 519, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, i); __PYX_ERR(0, 519, __pyx_L3_error) } } @@ -13003,7 +12910,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g __pyx_t_5 = 0; { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_t_3, __pyx_v_domains, __pyx_v_vconstraints, __pyx_t_4, Py_True}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_recursiveBacktracking, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_recursiveBacktracking, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -13026,7 +12933,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g goto __pyx_L4_next_or; } else { } - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_solutions, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_solutions, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 521, __pyx_L1_error) if (!__pyx_t_6) { @@ -13118,7 +13025,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 523, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 523, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -13141,7 +13048,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutions", 0) < 0) __PYX_ERR(0, 523, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutions", 0) < (0)) __PYX_ERR(0, 523, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, i); __PYX_ERR(0, 523, __pyx_L3_error) } } @@ -13227,7 +13134,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_6g __pyx_t_5 = 0; { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_t_3, __pyx_v_domains, __pyx_v_vconstraints, __pyx_t_4, Py_False}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_recursiveBacktracking, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_recursiveBacktracking, __pyx_callargs+__pyx_t_5, (6-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -13310,7 +13217,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_steps,&__pyx_mstate_global->__pyx_n_u_rand,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 554, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 554, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: @@ -13329,7 +13236,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 554, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 554, __pyx_L3_error) if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_1000))); if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None)); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { @@ -13396,7 +13303,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver___init__(CY * self._rand = rand * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_steps_2, __pyx_v_steps) < 0) __PYX_ERR(0, 563, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_steps_2, __pyx_v_steps) < (0)) __PYX_ERR(0, 563, __pyx_L1_error) /* "constraint/solvers.py":564 * """ @@ -13405,7 +13312,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver___init__(CY * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rand_2, __pyx_v_rand) < 0) __PYX_ERR(0, 564, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rand_2, __pyx_v_rand) < (0)) __PYX_ERR(0, 564, __pyx_L1_error) /* "constraint/solvers.py":554 * """ @@ -13477,7 +13384,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 566, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 566, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -13500,7 +13407,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < 0) __PYX_ERR(0, 566, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < (0)) __PYX_ERR(0, 566, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, i); __PYX_ERR(0, 566, __pyx_L3_error) } } @@ -13584,16 +13491,15 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio PyObject *__pyx_t_10 = NULL; size_t __pyx_t_11; PyObject *(*__pyx_t_12)(PyObject *); - Py_ssize_t __pyx_t_13; - PyObject *(*__pyx_t_14)(PyObject *); + PyObject *(*__pyx_t_13)(PyObject *); + PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *(*__pyx_t_17)(PyObject *); - int __pyx_t_18; - Py_ssize_t __pyx_t_19; - PyObject *(*__pyx_t_20)(PyObject *); - PyObject *__pyx_t_21 = NULL; - int __pyx_t_22; + PyObject *(*__pyx_t_16)(PyObject *); + int __pyx_t_17; + Py_ssize_t __pyx_t_18; + PyObject *(*__pyx_t_19)(PyObject *); + PyObject *__pyx_t_20 = NULL; + int __pyx_t_21; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -13720,7 +13626,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -13740,59 +13646,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * lst = list(domains.keys()) */ __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_range); - __pyx_t_9 = __pyx_builtin_range; - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_steps_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_steps_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = 1; { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_10}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_9}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); - __pyx_t_6 = 0; - __pyx_t_12 = NULL; - } else { - __pyx_t_6 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 573, __pyx_L1_error) - } + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 573, __pyx_L1_error) - #endif - if (__pyx_t_6 >= __pyx_temp) break; - } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_6); - ++__pyx_t_6; - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 573, __pyx_L1_error) - #endif - if (__pyx_t_6 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_6)); - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_6); - #endif - ++__pyx_t_6; - } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) - } else { + { __pyx_t_1 = __pyx_t_12(__pyx_t_9); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); @@ -13825,11 +13695,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio */ __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 575, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v_lst, ((PyObject*)__pyx_t_10)); - __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_v_lst, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; /* "constraint/solvers.py":576 * conflicted = False @@ -13840,28 +13710,28 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio */ __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_v_shuffle); - __pyx_t_2 = __pyx_v_shuffle; + __pyx_t_10 = __pyx_v_shuffle; __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10); assert(__pyx_t_1); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_10, __pyx__function); __pyx_t_11 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_lst}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 576, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":577 * lst = list(domains.keys()) @@ -13870,22 +13740,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * # Check if variable is not in conflict * for constraint, variables in vconstraints[variable]: */ - __pyx_t_10 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_10); - __pyx_t_5 = 0; + __pyx_t_2 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_2); + __pyx_t_6 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 577, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_6 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_5); - ++__pyx_t_5; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_6; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_10); + __pyx_t_10 = 0; /* "constraint/solvers.py":579 * for variable in lst: @@ -13894,49 +13764,49 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if not constraint(variables, domains, assignments): * break */ - __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); - __pyx_t_13 = 0; - __pyx_t_14 = NULL; + __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) { + __pyx_t_1 = __pyx_t_10; __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = 0; + __pyx_t_13 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 579, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; for (;;) { - if (likely(!__pyx_t_14)) { + if (likely(!__pyx_t_13)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 579, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_13); - ++__pyx_t_13; + __pyx_t_10 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 579, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13)); + __pyx_t_10 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5)); #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_13); + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); #endif - ++__pyx_t_13; + ++__pyx_t_5; } - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 579, __pyx_L1_error) } else { - __pyx_t_2 = __pyx_t_14(__pyx_t_1); - if (unlikely(!__pyx_t_2)) { + __pyx_t_10 = __pyx_t_13(__pyx_t_1); + if (unlikely(!__pyx_t_10)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 579, __pyx_L1_error) @@ -13945,9 +13815,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio break; } } - __Pyx_GOTREF(__pyx_t_2); - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; + __Pyx_GOTREF(__pyx_t_10); + if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) { + PyObject* sequence = __pyx_t_10; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); @@ -13958,48 +13828,48 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_4); - __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_15); + __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_14); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_15 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_14 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_14); } #else __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_15 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); + __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else { Py_ssize_t index = -1; - __pyx_t_16 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 579, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_16); - index = 0; __pyx_t_4 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_15 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_15)) goto __pyx_L11_unpacking_failed; + __pyx_t_15 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 579, __pyx_L1_error) - __pyx_t_17 = NULL; - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_15); + index = 0; __pyx_t_4 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_14 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_14)) goto __pyx_L11_unpacking_failed; + __Pyx_GOTREF(__pyx_t_14); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 2) < (0)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_16 = NULL; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L12_unpacking_done; __pyx_L11_unpacking_failed:; - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_16 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 579, __pyx_L1_error) __pyx_L12_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_15); - __pyx_t_15 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_14); + __pyx_t_14 = 0; /* "constraint/solvers.py":580 * # Check if variable is not in conflict @@ -14008,33 +13878,33 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * break * else: */ - __pyx_t_15 = NULL; + __pyx_t_14 = NULL; __Pyx_INCREF(__pyx_v_constraint); __pyx_t_4 = __pyx_v_constraint; __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_4); - assert(__pyx_t_15); + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_14); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_15); + __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); __pyx_t_11 = 0; } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_15, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_11, (4-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + PyObject *__pyx_callargs[4] = {__pyx_t_14, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments}; + __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_11, (4-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); } - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_18 = (!__pyx_t_3); - if (__pyx_t_18) { + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_17 = (!__pyx_t_3); + if (__pyx_t_17) { /* "constraint/solvers.py":581 * for constraint, variables in vconstraints[variable]: @@ -14090,9 +13960,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio */ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_mincount, __pyx_t_1); __pyx_t_1 = 0; @@ -14119,45 +13989,45 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); - __pyx_t_13 = 0; - __pyx_t_14 = NULL; + __pyx_t_10 = __pyx_t_1; __Pyx_INCREF(__pyx_t_10); + __pyx_t_5 = 0; + __pyx_t_13 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 587, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(!__pyx_t_13)) { + if (likely(PyList_CheckExact(__pyx_t_10))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 587, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); - ++__pyx_t_13; + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_5; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 587, __pyx_L1_error) #endif - if (__pyx_t_13 >= __pyx_temp) break; + if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_5)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_5); #endif - ++__pyx_t_13; + ++__pyx_t_5; } if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_14(__pyx_t_2); + __pyx_t_1 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { @@ -14201,44 +14071,44 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); - __pyx_t_19 = 0; - __pyx_t_20 = NULL; + __pyx_t_18 = 0; + __pyx_t_19 = NULL; } else { - __pyx_t_19 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_18 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_20 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_19 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 590, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_20)) { + if (likely(!__pyx_t_19)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 590, __pyx_L1_error) #endif - if (__pyx_t_19 >= __pyx_temp) break; + if (__pyx_t_18 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_19); - ++__pyx_t_19; + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_18, __Pyx_ReferenceSharing_OwnStrongReference); + ++__pyx_t_18; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 590, __pyx_L1_error) #endif - if (__pyx_t_19 >= __pyx_temp) break; + if (__pyx_t_18 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_19)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_18)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_19); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_18); #endif - ++__pyx_t_19; + ++__pyx_t_18; } if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) } else { - __pyx_t_1 = __pyx_t_20(__pyx_t_4); + __pyx_t_1 = __pyx_t_19(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { @@ -14259,50 +14129,50 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_14); + __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_15); - __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_16); } else { - __pyx_t_15 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_14 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_15); - __pyx_t_16 = __Pyx_PyList_GetItemRef(sequence, 1); - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 590, __pyx_L1_error) - __Pyx_XGOTREF(__pyx_t_16); } #else - __pyx_t_15 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_16); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_21 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 590, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_21); + __pyx_t_20 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_21); - index = 0; __pyx_t_15 = __pyx_t_17(__pyx_t_21); if (unlikely(!__pyx_t_15)) goto __pyx_L20_unpacking_failed; + __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_20); + index = 0; __pyx_t_14 = __pyx_t_16(__pyx_t_20); if (unlikely(!__pyx_t_14)) goto __pyx_L20_unpacking_failed; + __Pyx_GOTREF(__pyx_t_14); + index = 1; __pyx_t_15 = __pyx_t_16(__pyx_t_20); if (unlikely(!__pyx_t_15)) goto __pyx_L20_unpacking_failed; __Pyx_GOTREF(__pyx_t_15); - index = 1; __pyx_t_16 = __pyx_t_17(__pyx_t_21); if (unlikely(!__pyx_t_16)) goto __pyx_L20_unpacking_failed; - __Pyx_GOTREF(__pyx_t_16); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_21), 2) < 0) __PYX_ERR(0, 590, __pyx_L1_error) - __pyx_t_17 = NULL; - __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; + if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_20), 2) < (0)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_16 = NULL; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; goto __pyx_L21_unpacking_done; __pyx_L20_unpacking_failed:; - __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; - __pyx_t_17 = NULL; + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + __pyx_t_16 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 590, __pyx_L1_error) __pyx_L21_unpacking_done:; } - __Pyx_DECREF_SET(__pyx_v_constraint, __pyx_t_15); + __Pyx_DECREF_SET(__pyx_v_constraint, __pyx_t_14); + __pyx_t_14 = 0; + __Pyx_DECREF_SET(__pyx_v_variables, __pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF_SET(__pyx_v_variables, __pyx_t_16); - __pyx_t_16 = 0; /* "constraint/solvers.py":591 * count = 0 @@ -14311,32 +14181,32 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * count += 1 * if count == mincount: */ - __pyx_t_16 = NULL; + __pyx_t_15 = NULL; __Pyx_INCREF(__pyx_v_constraint); - __pyx_t_15 = __pyx_v_constraint; + __pyx_t_14 = __pyx_v_constraint; __pyx_t_11 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_15))) { - __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15); - assert(__pyx_t_16); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_16); + if (unlikely(PyMethod_Check(__pyx_t_14))) { + __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); + assert(__pyx_t_15); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14); + __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_15, __pyx__function); + __Pyx_DECREF_SET(__pyx_t_14, __pyx__function); __pyx_t_11 = 0; } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_16, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+__pyx_t_11, (4-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + PyObject *__pyx_callargs[4] = {__pyx_t_15, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_11, (4-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (!__pyx_t_18); + __pyx_t_3 = (!__pyx_t_17); if (__pyx_t_3) { /* "constraint/solvers.py":592 @@ -14389,7 +14259,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * elif count < mincount: * mincount = count */ - __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_minvalues, __pyx_v_value); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_minvalues, __pyx_v_value); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(0, 594, __pyx_L1_error) /* "constraint/solvers.py":593 * if not constraint(variables, domains, assignments): @@ -14430,7 +14300,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * minvalues.append(value) * # Pick a random one from these values. */ - if (__Pyx_PyObject_DelSlice(__pyx_v_minvalues, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 597, __pyx_L1_error) + if (__Pyx_PyObject_DelSlice(__pyx_v_minvalues, 0, 0, NULL, NULL, NULL, 0, 0, 1) < (0)) __PYX_ERR(0, 597, __pyx_L1_error) /* "constraint/solvers.py":598 * mincount = count @@ -14439,7 +14309,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * # Pick a random one from these values. * assignments[variable] = choice(minvalues) */ - __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_minvalues, __pyx_v_value); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 598, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_minvalues, __pyx_v_value); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(0, 598, __pyx_L1_error) /* "constraint/solvers.py":595 * if count == mincount: @@ -14459,7 +14329,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * count = 0 */ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "constraint/solvers.py":600 * minvalues.append(value) @@ -14485,14 +14355,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_minvalues}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); } - if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_variable, __pyx_t_2) < 0))) __PYX_ERR(0, 600, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_variable, __pyx_t_10) < 0))) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "constraint/solvers.py":601 * # Pick a random one from these values. @@ -14512,7 +14382,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio */ __pyx_L7_continue:; } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":602 * assignments[variable] = choice(minvalues) @@ -14582,9 +14452,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); - __Pyx_XDECREF(__pyx_t_16); - __Pyx_XDECREF(__pyx_t_21); + __Pyx_XDECREF(__pyx_t_20); __Pyx_AddTraceback("constraint.solvers.MinConflictsSolver.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -14654,7 +14524,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_process_mode,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 644, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 644, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 2: @@ -14669,7 +14539,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 644, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 644, __pyx_L3_error) if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_False))); for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(0, 644, __pyx_L3_error) } @@ -14722,8 +14592,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - size_t __pyx_t_7; + size_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -14737,27 +14606,24 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON * self.requires_pickling = process_mode */ __pyx_t_4 = NULL; - __Pyx_INCREF(__pyx_builtin_super); - __pyx_t_5 = __pyx_builtin_super; - __pyx_t_6 = __Pyx_CyFunction_GetClassObj(__pyx_self); - if (!__pyx_t_6) { PyErr_SetString(PyExc_RuntimeError, "super(): empty __class__ cell"); __PYX_ERR(0, 646, __pyx_L1_error) } - __Pyx_INCREF(__pyx_t_6); - __pyx_t_7 = 1; + __pyx_t_5 = __Pyx_CyFunction_GetClassObj(__pyx_self); + if (!__pyx_t_5) { PyErr_SetString(PyExc_RuntimeError, "super(): empty __class__ cell"); __PYX_ERR(0, 646, __pyx_L1_error) } + __Pyx_INCREF(__pyx_t_5); + __pyx_t_6 = 1; { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_6, __pyx_v_self}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, __pyx_v_self}; + __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_super, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); - __pyx_t_7 = 0; + __pyx_t_6 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) @@ -14772,7 +14638,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON * self.requires_pickling = process_mode * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_process_mode_2, __pyx_v_process_mode) < 0) __PYX_ERR(0, 647, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_process_mode_2, __pyx_v_process_mode) < (0)) __PYX_ERR(0, 647, __pyx_L1_error) /* "constraint/solvers.py":648 * super().__init__() @@ -14781,7 +14647,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_requires_pickling, __pyx_v_process_mode) < 0) __PYX_ERR(0, 648, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_requires_pickling, __pyx_v_process_mode) < (0)) __PYX_ERR(0, 648, __pyx_L1_error) /* "constraint/solvers.py":644 * """ # noqa E501 @@ -14800,7 +14666,6 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("constraint.solvers.ParallelSolver.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -14860,7 +14725,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 650, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 650, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -14883,7 +14748,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < 0) __PYX_ERR(0, 650, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolution", 0) < (0)) __PYX_ERR(0, 650, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 4, 4, i); __PYX_ERR(0, 650, __pyx_L3_error) } } @@ -14945,8 +14810,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(CY __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; + size_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -14967,7 +14831,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(CY __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_only_provides_all_solutions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat__Pyx_ReferenceSharing_OwnStrongReferenceInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_only_provides_all_solutions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); @@ -14981,14 +14845,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(CY * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 */ __pyx_t_1 = NULL; - __Pyx_INCREF(__pyx_builtin_NotImplementedError); - __pyx_t_3 = __pyx_builtin_NotImplementedError; - __pyx_t_4 = 1; + __pyx_t_3 = 1; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_msg}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } @@ -15008,7 +14869,6 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(CY __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.solvers.ParallelSolver.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XDECREF(__pyx_v_msg); @@ -15067,7 +14927,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 662, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 662, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: @@ -15086,7 +14946,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionsList", 0) < 0) __PYX_ERR(0, 662, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutionsList", 0) < (0)) __PYX_ERR(0, 662, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutionsList", 1, 3, 3, i); __PYX_ERR(0, 662, __pyx_L3_error) } } @@ -15185,7 +15045,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_v,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 668, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 668, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: @@ -15196,7 +15056,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lambda3", 0) < 0) __PYX_ERR(0, 668, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "lambda3", 0) < (0)) __PYX_ERR(0, 668, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("lambda3", 1, 1, 1, i); __PYX_ERR(0, 668, __pyx_L3_error) } } @@ -15366,7 +15226,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -15504,18 +15364,17 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - size_t __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - int __pyx_t_12; + size_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - PyObject *(*__pyx_t_17)(PyObject *); - int __pyx_t_18; - PyObject *__pyx_t_19 = NULL; - int __pyx_t_20; + PyObject *(*__pyx_t_16)(PyObject *); + int __pyx_t_17; + PyObject *__pyx_t_18 = NULL; + int __pyx_t_19; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -15586,24 +15445,21 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * # Split parallel and sequential parts */ __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_sorted); - __pyx_t_8 = __pyx_builtin_sorted; - __pyx_t_6 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_v_domains); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_v_domains); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_16getSolutionsList_lambda3, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver_getSolutionsList_2, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_16getSolutionsList_lambda3, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver_getSolutionsList_2, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = 1; + __pyx_t_9 = 1; { - PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_6}; - __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 668, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_key, __pyx_t_9, __pyx_t_11, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 668, __pyx_L1_error) - __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11); + PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_t_8}; + __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_key, __pyx_t_6, __pyx_t_10, __pyx_callargs+2, 0) < (0)) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_builtin_sorted, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } @@ -15622,7 +15478,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 671, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_sorted_vars, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_sorted_vars, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_first_var = __pyx_t_1; @@ -15654,11 +15510,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi */ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_first_var); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __pyx_pf_10constraint_7solvers_14ParallelSolver_16getSolutionsList_1genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_10 = __pyx_pf_10constraint_7solvers_14ParallelSolver_16getSolutionsList_1genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_args = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_v_args = __pyx_t_10; + __pyx_t_10 = 0; /* "constraint/solvers.py":676 * # Create the parallel function arguments and solutions lists @@ -15667,10 +15523,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * * # execute in parallel */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 676, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_v_solutions = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_v_solutions = ((PyObject*)__pyx_t_10); + __pyx_t_10 = 0; /* "constraint/solvers.py":679 * @@ -15681,21 +15537,21 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_process_mode_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_12) { + if (__pyx_t_11) { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ProcessPoolExecutor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __pyx_t_1; + __pyx_t_10 = __pyx_t_1; __pyx_t_1 = 0; } else { __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ThreadPoolExecutor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __pyx_t_1; + __pyx_t_10 = __pyx_t_1; __pyx_t_1 = 0; } - __pyx_v_parallel_pool = __pyx_t_8; - __pyx_t_8 = 0; + __pyx_v_parallel_pool = __pyx_t_10; + __pyx_t_10 = 0; /* "constraint/solvers.py":680 * # execute in parallel @@ -15707,66 +15563,66 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi /*with:*/ { __pyx_t_1 = NULL; __Pyx_INCREF(__pyx_v_parallel_pool); - __pyx_t_11 = __pyx_v_parallel_pool; - __pyx_t_10 = 1; + __pyx_t_6 = __pyx_v_parallel_pool; + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11); + if (unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); assert(__pyx_t_1); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_11, __pyx__function); - __pyx_t_10 = 0; + __Pyx_DECREF_SET(__pyx_t_6, __pyx__function); + __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); } - __pyx_t_13 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __pyx_t_1 = NULL; - __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 680, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = 1; + __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 680, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); assert(__pyx_t_1); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_9, __pyx__function); - __pyx_t_10 = 0; + __Pyx_DECREF_SET(__pyx_t_8, __pyx__function); + __pyx_t_9 = 0; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 680, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_6); } - __pyx_t_9 = __pyx_t_11; - __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); + __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); - __Pyx_XGOTREF(__pyx_t_16); /*try:*/ { - __pyx_v_executor = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_executor = __pyx_t_8; + __pyx_t_8 = 0; /* "constraint/solvers.py":682 * with parallel_pool() as executor: @@ -15775,25 +15631,25 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * for result in results: * solutions.extend(result) */ - __pyx_t_8 = __pyx_v_executor; - __Pyx_INCREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_parallel_worker); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 682, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = 0; + __pyx_t_10 = __pyx_v_executor; + __Pyx_INCREF(__pyx_t_10); + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_parallel_worker); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = 0; { - PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_t_11, __pyx_v_args}; + PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_10, __pyx_t_6, __pyx_v_args}; __pyx_t_1 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_chunksize, __pyx_mstate_global->__pyx_int_1, __pyx_t_1, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 682, __pyx_L13_error) - __pyx_t_9 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_map, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_chunksize, __pyx_mstate_global->__pyx_int_1, __pyx_t_1, __pyx_callargs+3, 0) < (0)) __PYX_ERR(0, 682, __pyx_L13_error) + __pyx_t_8 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_map, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_1); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 682, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_9); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 682, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_8); } - __pyx_v_results = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_results = __pyx_t_8; + __pyx_t_8 = 0; /* "constraint/solvers.py":683 * # results = map(parallel_worker, args) # sequential @@ -15803,44 +15659,44 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * */ if (likely(PyList_CheckExact(__pyx_v_results)) || PyTuple_CheckExact(__pyx_v_results)) { - __pyx_t_9 = __pyx_v_results; __Pyx_INCREF(__pyx_t_9); + __pyx_t_8 = __pyx_v_results; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0; - __pyx_t_17 = NULL; + __pyx_t_16 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_results); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 683, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 683, __pyx_L13_error) + __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_results); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 683, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 683, __pyx_L13_error) } for (;;) { - if (likely(!__pyx_t_17)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { + if (likely(!__pyx_t_16)) { + if (likely(PyList_CheckExact(__pyx_t_8))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 683, __pyx_L13_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_4); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_4; } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 683, __pyx_L13_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_4)); + __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4)); #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_4); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_4); #endif ++__pyx_t_4; } if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L13_error) } else { - __pyx_t_1 = __pyx_t_17(__pyx_t_9); + __pyx_t_1 = __pyx_t_16(__pyx_t_8); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { @@ -15861,7 +15717,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * * return solutions */ - __pyx_t_18 = __Pyx_PyList_Extend(__pyx_v_solutions, __pyx_v_result); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 684, __pyx_L13_error) + __pyx_t_17 = __Pyx_PyList_Extend(__pyx_v_solutions, __pyx_v_result); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 684, __pyx_L13_error) /* "constraint/solvers.py":683 * # results = map(parallel_worker, args) # sequential @@ -15871,7 +15727,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * */ } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/solvers.py":680 * # execute in parallel @@ -15881,69 +15737,68 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * results = executor.map(parallel_worker, args, chunksize=1) # parallel */ } + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L18_try_end; __pyx_L13_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /*except:*/ { __Pyx_AddTraceback("constraint.solvers.ParallelSolver.getSolutionsList", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_1, &__pyx_t_11) < 0) __PYX_ERR(0, 680, __pyx_L15_except_error) - __Pyx_XGOTREF(__pyx_t_9); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_1, &__pyx_t_6) < 0) __PYX_ERR(0, 680, __pyx_L15_except_error) + __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_11); - __pyx_t_8 = PyTuple_Pack(3, __pyx_t_9, __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 680, __pyx_L15_except_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_8, NULL); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 680, __pyx_L15_except_error) - __Pyx_GOTREF(__pyx_t_19); - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_19); - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (__pyx_t_12 < 0) __PYX_ERR(0, 680, __pyx_L15_except_error) - __pyx_t_20 = (!__pyx_t_12); - if (unlikely(__pyx_t_20)) { - __Pyx_GIVEREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_10 = PyTuple_Pack(3, __pyx_t_8, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 680, __pyx_L15_except_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 680, __pyx_L15_except_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_18); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + if (__pyx_t_11 < (0)) __PYX_ERR(0, 680, __pyx_L15_except_error) + __pyx_t_19 = (!__pyx_t_11); + if (unlikely(__pyx_t_19)) { + __Pyx_GIVEREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_11); - __Pyx_ErrRestoreWithState(__pyx_t_9, __pyx_t_1, __pyx_t_11); - __pyx_t_9 = 0; __pyx_t_1 = 0; __pyx_t_11 = 0; + __Pyx_XGIVEREF(__pyx_t_6); + __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_1, __pyx_t_6); + __pyx_t_8 = 0; __pyx_t_1 = 0; __pyx_t_6 = 0; __PYX_ERR(0, 680, __pyx_L15_except_error) } - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L14_exception_handled; } __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); goto __pyx_L1_error; __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); - __Pyx_XGIVEREF(__pyx_t_16); - __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_L18_try_end:; } } /*finally:*/ { /*normal exit:*/{ - if (__pyx_t_13) { - __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[0], NULL); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_16); - __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; + if (__pyx_t_12) { + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_mstate_global->__pyx_tuple[0], NULL); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } goto __pyx_L12; } @@ -15951,7 +15806,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi } goto __pyx_L25; __pyx_L9_error:; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L1_error; __pyx_L25:; } @@ -15982,8 +15837,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("constraint.solvers.ParallelSolver.getSolutionsList", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -16052,7 +15906,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 688, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 688, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -16075,7 +15929,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutions", 0) < 0) __PYX_ERR(0, 688, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSolutions", 0) < (0)) __PYX_ERR(0, 688, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 4, 4, i); __PYX_ERR(0, 688, __pyx_L3_error) } } @@ -16155,7 +16009,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_6getSolutions(C __pyx_t_3 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_domains, __pyx_v_vconstraints}; - __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_getSolutionsList, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolutionsList, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -16234,7 +16088,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_assignment,&__pyx_mstate_global->__pyx_n_u_constraints_lookup,&__pyx_mstate_global->__pyx_n_u_domains,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 693, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 693, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 3: @@ -16253,7 +16107,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "is_valid", 0) < 0) __PYX_ERR(0, 693, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "is_valid", 0) < (0)) __PYX_ERR(0, 693, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 3; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("is_valid", 1, 3, 3, i); __PYX_ERR(0, 693, __pyx_L3_error) } } @@ -16398,7 +16252,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_7genexpr_2generator4(_ #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -16571,7 +16425,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -16590,10 +16444,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_5); } @@ -16614,7 +16468,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 697, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < (0)) __PYX_ERR(0, 697, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; @@ -16676,7 +16530,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_vars_involved, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_assignment, Py_None}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_9, (5-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (5-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error) @@ -16903,7 +16757,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_constraint,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 701, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 701, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: @@ -16914,7 +16768,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "compile_to_function", 0) < 0) __PYX_ERR(0, 701, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "compile_to_function", 0) < (0)) __PYX_ERR(0, 701, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("compile_to_function", 1, 1, 1, i); __PYX_ERR(0, 701, __pyx_L3_error) } } @@ -16957,8 +16811,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - size_t __pyx_t_4; + size_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; @@ -16986,14 +16840,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * return FunctionConstraint(func) */ __pyx_t_2 = NULL; - __Pyx_INCREF(__pyx_builtin_compile); - __pyx_t_3 = __pyx_builtin_compile; - __pyx_t_4 = 1; + __pyx_t_3 = 1; { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_func_string, __pyx_mstate_global->__pyx_kp_u_string, __pyx_mstate_global->__pyx_n_u_exec}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_compile, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } @@ -17007,35 +16858,35 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * return FunctionConstraint(func) * */ - __pyx_t_3 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_code_object, __pyx_mstate_global->__pyx_n_u_co_consts); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 705, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_Globals(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = 1; + __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - assert(__pyx_t_3); - PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); - __Pyx_DECREF_SET(__pyx_t_2, __pyx__function); - __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_3 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_6, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_6, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } @@ -17050,25 +16901,25 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * def sequential_recursive_backtrack(assignment: dict[Hashable, any], unassigned_vars: list[Hashable], domains: dict[Hashable, Domain], constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa E501 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = NULL; + __pyx_t_4 = NULL; __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = 1; + __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); - assert(__pyx_t_2); + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_4); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); - __pyx_t_4 = 0; + __pyx_t_3 = 0; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_func}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_func}; + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -17089,7 +16940,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("constraint.solvers.compile_to_function", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -17154,7 +17005,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_assignment,&__pyx_mstate_global->__pyx_n_u_unassigned_vars,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraint_lookup,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 708, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 708, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -17177,7 +17028,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sequential_recursive_backtrack", 0) < 0) __PYX_ERR(0, 708, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sequential_recursive_backtrack", 0) < (0)) __PYX_ERR(0, 708, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sequential_recursive_backtrack", 1, 4, 4, i); __PYX_ERR(0, 708, __pyx_L3_error) } } @@ -17264,8 +17115,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * return [assignment.copy()] * */ - __pyx_t_1 = (__Pyx_PyList_GET_SIZE(__pyx_v_unassigned_vars) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 710, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_unassigned_vars); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 710, __pyx_L1_error) + __pyx_t_1 = (__pyx_temp != 0); + } + __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { @@ -17304,7 +17159,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * remaining_vars = unassigned_vars[:-1] * */ - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_unassigned_vars, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_unassigned_vars, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_var = __pyx_t_4; __pyx_t_4 = 0; @@ -17362,7 +17217,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( #endif if (__pyx_t_5 >= __pyx_temp) break; } - __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); + __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_5; } else { { @@ -17430,7 +17285,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( #endif { PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_assignment, __pyx_t_9, __pyx_v_domains}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_10, (4-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (4-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -17465,7 +17320,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( #endif { PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_v_assignment, __pyx_v_remaining_vars, __pyx_v_domains, __pyx_v_constraint_lookup}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_10, (5-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_10, (5-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error) @@ -17592,7 +17447,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_assignment,&__pyx_mstate_global->__pyx_n_u_unassigned_vars,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraint_lookup,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 724, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 724, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 4: @@ -17615,7 +17470,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sequential_optimized_backtrack", 0) < 0) __PYX_ERR(0, 724, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sequential_optimized_backtrack", 0) < (0)) __PYX_ERR(0, 724, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sequential_optimized_backtrack", 1, 4, 4, i); __PYX_ERR(0, 724, __pyx_L3_error) } } @@ -17770,7 +17625,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -17855,8 +17710,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * return solutions * variable, values = queue.pop() */ - __pyx_t_4 = (__Pyx_PyList_GET_SIZE(__pyx_v_queue) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_4 < 0))) __PYX_ERR(0, 744, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_queue); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 744, __pyx_L1_error) + __pyx_t_4 = (__pyx_temp != 0); + } + __pyx_t_7 = (!__pyx_t_4); if (__pyx_t_7) { @@ -17905,10 +17764,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); } @@ -17929,7 +17788,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 746, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < (0)) __PYX_ERR(0, 746, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L12_unpacking_done; @@ -17984,8 +17843,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if values: */ while (1) { - __pyx_t_4 = (__Pyx_PyList_GET_SIZE(__pyx_v_queue) != 0); - if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_4 < 0))) __PYX_ERR(0, 753, __pyx_L1_error) + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_v_queue); + if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(0, 753, __pyx_L1_error) + __pyx_t_4 = (__pyx_temp != 0); + } + if (!__pyx_t_4) break; /* "constraint/solvers.py":754 @@ -18012,10 +17875,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_5); } @@ -18036,7 +17899,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L18_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 754, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < (0)) __PYX_ERR(0, 754, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L19_unpacking_done; @@ -18155,7 +18018,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack #endif if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_2); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_5, __pyx_t_2, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_2; } else { { @@ -18200,10 +18063,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_XGOTREF(__pyx_t_8); } @@ -18224,7 +18087,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L23_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_11), 2) < 0) __PYX_ERR(0, 763, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_11), 2) < (0)) __PYX_ERR(0, 763, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L24_unpacking_done; @@ -18264,7 +18127,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack #endif { PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, Py_None}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_12, (5-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_12, (5-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error) @@ -18422,7 +18285,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_args,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 774, __pyx_L3_error) + if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 774, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: @@ -18433,7 +18296,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "parallel_worker", 0) < 0) __PYX_ERR(0, 774, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "parallel_worker", 0) < (0)) __PYX_ERR(0, 774, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("parallel_worker", 1, 1, 1, i); __PYX_ERR(0, 774, __pyx_L3_error) } } @@ -18575,7 +18438,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED */ __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_v_first_var, __pyx_v_first_value) < 0) __PYX_ERR(0, 777, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_v_first_var, __pyx_v_first_value) < (0)) __PYX_ERR(0, 777, __pyx_L1_error) __pyx_v_local_assignment = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; @@ -18646,7 +18509,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED #endif if (__pyx_t_12 >= __pyx_temp) break; } - __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_12); + __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_5, __pyx_t_12, __Pyx_ReferenceSharing_OwnStrongReference); ++__pyx_t_12; } else { { @@ -18691,10 +18554,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_1); } else { - __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_XGOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); + __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_XGOTREF(__pyx_t_1); } @@ -18715,7 +18578,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 782, __pyx_L8_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < (0)) __PYX_ERR(0, 782, __pyx_L8_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L12_unpacking_done; @@ -18752,7 +18615,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_9genexpr11__pyx_v_constraint}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_16, (2-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_16, (2-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) @@ -18828,7 +18691,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_local_assignment, __pyx_t_3, __pyx_v_domains}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_16, (4-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_16, (4-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -18864,7 +18727,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED #endif { PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_local_assignment, __pyx_v_remaining_vars, __pyx_v_domains, __pyx_v_constraint_lookup}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_16, (5-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_16, (5-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 786, __pyx_L1_error) @@ -18936,30 +18799,33 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct__getSolutionIter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct__getSolutionIter[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct__getSolutionIter(PyObject *o) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct__getSolutionIter) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -18984,19 +18850,24 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct__getSoluti Py_CLEAR(p->__pyx_v_vconstraints); Py_CLEAR(p->__pyx_8genexpr1__pyx_v_x); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct__getSolutionIter[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -19071,7 +18942,7 @@ static PyType_Spec __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolut "constraint.solvers.__pyx_scope_struct__getSolutionIter", sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter_slots, }; #else @@ -19082,12 +18953,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolu sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct__getSolutionIter, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -19101,7 +18967,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolu 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct__getSolutionIter, /*tp_traverse*/ 0, /*tp_clear*/ @@ -19136,7 +19002,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolu #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -19156,30 +19022,33 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolu static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter(PyObject *o) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -19202,19 +19071,24 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_1_getSolut Py_CLEAR(p->__pyx_v_vconstraints); Py_CLEAR(p->__pyx_8genexpr2__pyx_v_x); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -19283,7 +19157,7 @@ static PyType_Spec __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolu "constraint.solvers.__pyx_scope_struct_1_getSolutionIter", sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter_slots, }; #else @@ -19294,12 +19168,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSol sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -19313,7 +19182,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSol 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter, /*tp_traverse*/ 0, /*tp_clear*/ @@ -19348,7 +19217,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSol #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -19368,30 +19237,33 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSol static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList(PyObject *o) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -19404,19 +19276,24 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_2_getSolut Py_CLEAR(p->__pyx_v_remaining_vars); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -19477,7 +19354,7 @@ static PyType_Spec __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolu "constraint.solvers.__pyx_scope_struct_2_getSolutionsList", sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList_slots, }; #else @@ -19488,12 +19365,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSol sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -19507,7 +19379,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSol 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList, /*tp_traverse*/ __pyx_tp_clear_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList, /*tp_clear*/ @@ -19542,7 +19414,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSol #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -19562,30 +19434,33 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSol static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_3_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_3_genexpr(PyObject *o) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_3_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -19597,19 +19472,24 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_3_genexpr( Py_CLEAR(p->__pyx_v_val); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_3_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -19645,7 +19525,7 @@ static PyType_Spec __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr "constraint.solvers.__pyx_scope_struct_3_genexpr", sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr_slots, }; #else @@ -19656,12 +19536,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexp sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -19675,7 +19550,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexp 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_3_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -19710,7 +19585,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexp #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -19730,30 +19605,33 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexp static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_4_is_valid(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_4_is_valid[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_4_is_valid(PyObject *o) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_4_is_valid) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -19763,19 +19641,24 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_4_is_valid Py_CLEAR(p->__pyx_v_assignment); Py_CLEAR(p->__pyx_v_domains); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_4_is_valid[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -19818,7 +19701,7 @@ static PyType_Spec __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_vali "constraint.solvers.__pyx_scope_struct_4_is_valid", sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid_slots, }; #else @@ -19829,12 +19712,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_val sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_4_is_valid, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -19848,7 +19726,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_val 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_4_is_valid, /*tp_traverse*/ __pyx_tp_clear_10constraint_7solvers___pyx_scope_struct_4_is_valid, /*tp_clear*/ @@ -19883,7 +19761,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_val #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -19903,30 +19781,33 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_val static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_5_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_5_genexpr(PyObject *o) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_5_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -19939,19 +19820,24 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_5_genexpr( Py_CLEAR(p->__pyx_v_genexpr); Py_CLEAR(p->__pyx_v_vars_involved); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_5_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -19990,7 +19876,7 @@ static PyType_Spec __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr "constraint.solvers.__pyx_scope_struct_5_genexpr", sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr_slots, }; #else @@ -20001,12 +19887,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexp sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -20020,7 +19901,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexp 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_5_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -20055,7 +19936,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexp #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -20075,30 +19956,33 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexp static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; - #if CYTHON_COMPILING_IN_LIMITED_API - allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); - o = alloc_func(t, 0); - #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr)))) + { o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_6_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr]; + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(Py_TYPE(o)); + #endif memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr)); + #if CYTHON_COMPILING_IN_LIMITED_API + (void) PyObject_Init(o, t); + #else (void) PyObject_INIT(o, t); + #endif PyObject_GC_Track(o); } else #endif { - o = (*t->tp_alloc)(t, 0); + o = __Pyx_AllocateExtensionType(t, 1); if (unlikely(!o)) return 0; } - #endif return o; } static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_6_genexpr(PyObject *o) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *)o; #if CYTHON_USE_TP_FINALIZE - if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_6_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } @@ -20109,19 +19993,24 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_6_genexpr( Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_v); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr)))) { + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr)))) + { __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_6_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *)o); } else #endif { + PyTypeObject *tp = Py_TYPE(o); #if CYTHON_USE_TYPE_SLOTS - (*Py_TYPE(o)->tp_free)(o); + (*tp->tp_free)(o); #else { - freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free); if (tp_free) tp_free(o); } #endif + #if CYTHON_USE_TYPE_SPECS + Py_DECREF(tp); + #endif } } @@ -20154,7 +20043,7 @@ static PyType_Spec __pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr "constraint.solvers.__pyx_scope_struct_6_genexpr", sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr), 0, - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, __pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr_slots, }; #else @@ -20165,12 +20054,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexp sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ - #if PY_VERSION_HEX < 0x030800b4 - 0, /*tp_print*/ - #endif - #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ - #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_as_async*/ @@ -20184,7 +20068,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexp 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_6_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ @@ -20219,7 +20103,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexp #else NULL, /*tp_finalize*/ #endif - #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + #if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 @@ -20292,14 +20176,17 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter)) __PYX_ERR(0, 153, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter) < 0) __PYX_ERR(0, 153, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter) < (0)) __PYX_ERR(0, 153, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter = &__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter) < 0) __PYX_ERR(0, 153, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter) < (0)) __PYX_ERR(0, 153, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_getattro == PyObject_GenericGetAttr)) { @@ -20308,14 +20195,17 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)) __PYX_ERR(0, 276, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter) < 0) __PYX_ERR(0, 276, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter) < (0)) __PYX_ERR(0, 276, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter = &__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter) < 0) __PYX_ERR(0, 276, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter) < (0)) __PYX_ERR(0, 276, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_getattro == PyObject_GenericGetAttr)) { @@ -20324,14 +20214,17 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)) __PYX_ERR(0, 662, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList) < (0)) __PYX_ERR(0, 662, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList = &__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList) < (0)) __PYX_ERR(0, 662, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_getattro == PyObject_GenericGetAttr)) { @@ -20340,14 +20233,17 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 675, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 675, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(0, 675, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 675, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr) < (0)) __PYX_ERR(0, 675, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -20356,14 +20252,17 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid)) __PYX_ERR(0, 693, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid) < (0)) __PYX_ERR(0, 693, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid = &__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid) < (0)) __PYX_ERR(0, 693, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_getattro == PyObject_GenericGetAttr)) { @@ -20372,14 +20271,17 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr)) __PYX_ERR(0, 696, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 696, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr) < (0)) __PYX_ERR(0, 696, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr = &__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 696, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr) < (0)) __PYX_ERR(0, 696, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -20388,14 +20290,17 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { #endif #if CYTHON_USE_TYPE_SPECS __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr)) __PYX_ERR(0, 698, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 698, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr) < (0)) __PYX_ERR(0, 698, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr = &__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 698, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr) < (0)) __PYX_ERR(0, 698, __pyx_L1_error) + #endif + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr); #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_getattro == PyObject_GenericGetAttr)) { @@ -20443,7 +20348,7 @@ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_solvers}, #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - {Py_mod_gil, Py_MOD_GIL_USED}, + {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE}, #endif #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, @@ -20505,7 +20410,8 @@ __Pyx_PyMODINIT_FUNC PyInit_solvers(void) return PyModuleDef_Init(&__pyx_moduledef); } /* ModuleCreationPEP489 */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ + || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { { PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think @@ -20535,12 +20441,15 @@ static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { #if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { static PY_INT64_T main_interpreter_id = -1; -#if CYTHON_COMPILING_IN_GRAAL +#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000 + PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#elif CYTHON_COMPILING_IN_GRAAL PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000 - PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); -#elif CYTHON_COMPILING_IN_LIMITED_API +#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\ + || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000)) PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#elif CYTHON_COMPILING_IN_LIMITED_API + PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); #else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); #endif @@ -20612,11 +20521,12 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_solvers(PyObject *__pyx_pyinit_mod __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -20659,48 +20569,28 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_solvers(PyObject *__pyx_pyinit_mod if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /* ImportRefnannyAPI */ #if CYTHON_REFNANNY -__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); -if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); -} -#endif - -__Pyx_RefNannySetupContext("PyInit_solvers", 0); - if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pxy_PyFrame_Initialize_Offsets - __Pxy_PyFrame_Initialize_Offsets(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); + } #endif + +__Pyx_RefNannySetupContext("PyInit_solvers", 0); + __Pyx_init_runtime_version(); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Library function declarations ---*/ /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED) - if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ + if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error) if (__pyx_module_is_main_constraint__solvers) { - if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) } { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -20709,10 +20599,10 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); } } /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(__pyx_mstate); (void)__Pyx_modinit_variable_export_code(__pyx_mstate); @@ -20730,9 +20620,10 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * from types import FunctionType * from constraint.domain import Domain */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_random, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_random, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error) + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_random, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_random, __pyx_t_2) < (0)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":4 @@ -20742,16 +20633,22 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * from constraint.domain import Domain * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint */ - __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_types, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_FunctionType}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_types, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionType, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_FunctionType}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/solvers.py":5 * import random @@ -20760,15 +20657,21 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint * from collections.abc import Hashable */ - __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Domain}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Domain, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Domain}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 5, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":6 @@ -20778,24 +20681,22 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * from collections.abc import Hashable * */ - __pyx_t_2 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Constraint,__pyx_mstate_global->__pyx_n_u_FunctionConstraint,__pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_imported_names, 3, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Constraint,__pyx_mstate_global->__pyx_n_u_FunctionConstraint,__pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint}; + for (__pyx_t_3=0; __pyx_t_3 < 3; __pyx_t_3++) { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 6, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/solvers.py":7 * from constraint.domain import Domain @@ -20804,15 +20705,21 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * * # for parallel solver */ - __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Hashable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Hashable}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Hashable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Hashable, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Hashable}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 7, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":10 @@ -20822,20 +20729,22 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * * */ - __pyx_t_2 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_ProcessPoolExecutor, __pyx_mstate_global->__pyx_n_u_ThreadPoolExecutor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_concurrent_futures, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ProcessPoolExecutor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ProcessPoolExecutor, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ThreadPoolExecutor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ProcessPoolExecutor,__pyx_mstate_global->__pyx_n_u_ThreadPoolExecutor}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_concurrent_futures, __pyx_imported_names, 2, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ThreadPoolExecutor, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_ProcessPoolExecutor,__pyx_mstate_global->__pyx_n_u_ThreadPoolExecutor}; + for (__pyx_t_3=0; __pyx_t_3 < 2; __pyx_t_3++) { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/solvers.py":13 * @@ -20844,17 +20753,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Return a dictionary mapping pairs (arcs) of constrained variables. * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 13, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 13, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 13, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_1getArcs, 0, __pyx_mstate_global->__pyx_n_u_getArcs, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_getArcs, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 13, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 13, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_1getArcs, 0, __pyx_mstate_global->__pyx_n_u_getArcs, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_getArcs, __pyx_t_4) < (0)) __PYX_ERR(0, 13, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":28 * @@ -20863,18 +20775,21 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Perform the ARC-8 arc checking algorithm and prune domains. * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_arcs, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_3doArc8, 0, __pyx_mstate_global->__pyx_n_u_doArc8, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_arcs, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_3doArc8, 0, __pyx_mstate_global->__pyx_n_u_doArc8, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_doArc8, __pyx_t_2) < (0)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_doArc8, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/solvers.py":72 * @@ -20883,8 +20798,8 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Abstract base class for solvers.""" * */ - __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Solver, __pyx_mstate_global->__pyx_n_u_Solver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Abstract_base_class_for_solvers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Solver, __pyx_mstate_global->__pyx_n_u_Solver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Abstract_base_class_for_solvers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); /* "constraint/solvers.py":75 * """Abstract base class for solvers.""" @@ -20893,7 +20808,7 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): */ - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_requires_pickling, Py_False) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_requires_pickling, Py_False) < (0)) __PYX_ERR(0, 75, __pyx_L1_error) /* "constraint/solvers.py":77 * requires_pickling = False @@ -20902,17 +20817,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Return one solution for the given problem. * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_1getSolution, 0, __pyx_mstate_global->__pyx_n_u_Solver_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_4) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 77, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 77, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_1getSolution, 0, __pyx_mstate_global->__pyx_n_u_Solver_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_5) < (0)) __PYX_ERR(0, 77, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":89 * raise NotImplementedError(msg) @@ -20921,17 +20839,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Return all solutions for the given problem. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 89, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 89, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_3getSolutions, 0, __pyx_mstate_global->__pyx_n_u_Solver_getSolutions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 89, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 89, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 89, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_3getSolutions, 0, __pyx_mstate_global->__pyx_n_u_Solver_getSolutions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_4) < (0)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":101 * raise NotImplementedError(msg) @@ -20940,17 +20861,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Return an iterator for the solutions of the given problem. * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 101, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 101, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 101, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_5getSolutionIter, 0, __pyx_mstate_global->__pyx_n_u_Solver_getSolutionIter, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_4) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 101, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 101, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_5getSolutionIter, 0, __pyx_mstate_global->__pyx_n_u_Solver_getSolutionIter, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_5) < (0)) __PYX_ERR(0, 101, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":72 * @@ -20959,11 +20883,14 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Abstract base class for solvers.""" * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Solver, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Solver, __pyx_t_4) < 0) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Solver, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Solver, __pyx_t_5) < (0)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":114 * @@ -20972,21 +20899,21 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Problem solver with backtracking capabilities. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Problem_solver_with_backtracking); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Problem_solver_with_backtracking); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_2 != __pyx_t_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 114, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":143 * """ @@ -20995,11 +20922,14 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Initialization method. * */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1]); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[1]); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < (0)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":153 * self._forwardcheck = forwardcheck @@ -21008,17 +20938,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * forwardcheck = self._forwardcheck * assignments = {} */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_3getSolutionIter, 0, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver_getSolutionIt, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_6) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 153, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 153, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_3getSolutionIter, 0, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver_getSolutionIt, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_7) < (0)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":223 * raise RuntimeError("Can't happen") @@ -21027,17 +20960,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * iter = self.getSolutionIter(domains, constraints, vconstraints) * try: */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 223, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 223, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 223, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_6getSolution, 0, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_4) < 0) __PYX_ERR(0, 223, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 223, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 223, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_6getSolution, 0, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_5) < (0)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":230 * return None @@ -21046,17 +20982,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * return list(self.getSolutionIter(domains, constraints, vconstraints)) * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 230, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 230, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 230, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_8getSolutions, 0, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver_getSolutions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_6) < 0) __PYX_ERR(0, 230, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 230, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 230, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_8getSolutions, 0, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver_getSolutions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_7) < (0)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":114 * @@ -21065,13 +21004,16 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Problem solver with backtracking capabilities. * */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver, __pyx_t_6) < 0) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver, __pyx_t_7) < (0)) __PYX_ERR(0, 114, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/solvers.py":234 * @@ -21080,21 +21022,21 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Problem solver with backtracking capabilities, implementing several optimizations for increased performance. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Problem_solver_with_backtracking_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__pyx_t_3 != __pyx_t_2) { - if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Problem_solver_with_backtracking_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__pyx_t_2 != __pyx_t_4) { + if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 234, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":266 * """ @@ -21103,11 +21045,14 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Initialization method. * */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver___in, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1]); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver___in, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1]); + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < (0)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":276 * self._forwardcheck = forwardcheck @@ -21116,17 +21061,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * forwardcheck = self._forwardcheck * assignments = {} */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 276, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 276, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 276, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_3getSolutionIter, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_4) < 0) __PYX_ERR(0, 276, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 276, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 276, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_3getSolutionIter, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_5) < (0)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":344 * raise RuntimeError("Can't happen") @@ -21135,17 +21083,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Optimized all-solutions finder that skips forwardchecking and returns the solutions in a list. * */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < (0)) __PYX_ERR(0, 344, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_list_tuple_Constra) < (0)) __PYX_ERR(0, 344, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < (0)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_6getSolutionsList, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS_3, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_6getSolutionsList, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS_3, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_getSolutionsList, __pyx_t_4) < (0)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolutionsList, __pyx_t_2) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":401 * queue.append((variable, values)) @@ -21154,17 +21105,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * if self._forwardcheck: * return list(self.getSolutionIter(domains, constraints, vconstraints)) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 401, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 401, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 401, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_8getSolutions, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS_4, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_4) < 0) __PYX_ERR(0, 401, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 401, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 401, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_8getSolutions, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS_4, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_5) < (0)) __PYX_ERR(0, 401, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":406 * return self.getSolutionsList(domains, vconstraints) @@ -21173,17 +21127,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * iter = self.getSolutionIter(domains, constraints, vconstraints) * try: */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 406, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 406, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_10getSolution, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS_5, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 406, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 406, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 406, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_10getSolution, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS_5, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_4) < (0)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_2) < 0) __PYX_ERR(0, 406, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":413 * return None @@ -21192,17 +21149,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Sorts the list of variables on number of vconstraints to find unassigned variables quicker. * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_list) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_12getSortedVariables, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS_6, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSortedVariables, __pyx_t_4) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 413, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 413, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_list) < (0)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_12getSortedVariables, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS_6, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 413, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_getSortedVariables, __pyx_t_5) < (0)) __PYX_ERR(0, 413, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":234 * @@ -21211,13 +21171,16 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Problem solver with backtracking capabilities, implementing several optimizations for increased performance. * */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, __pyx_t_4) < 0) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, __pyx_t_5) < (0)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":428 * return [c for _, _, c in lst] @@ -21226,21 +21189,21 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Recursive problem solver with backtracking capabilities. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Recursive_problem_solver_with_ba); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_3 != __pyx_t_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Recursive_problem_solver_with_ba); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_2 != __pyx_t_6) { + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 428, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/solvers.py":456 * """ @@ -21249,11 +21212,14 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Initialization method. * */ - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver___in, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[1]); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 456, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver___in, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1]); + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < (0)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/solvers.py":466 * self._forwardcheck = forwardcheck @@ -21262,10 +21228,13 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Mix the Degree and Minimum Remaing Values (MRV) heuristics. * */ - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_3recursiveBacktracking, 0, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver_recu_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_recursiveBacktracking, __pyx_t_5) < 0) __PYX_ERR(0, 466, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_3recursiveBacktracking, 0, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver_recu_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_recursiveBacktracking, __pyx_t_6) < (0)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/solvers.py":519 * return solutions @@ -21274,17 +21243,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * solutions = self.recursiveBacktracking([], domains, vconstraints, {}, True) * return solutions and solutions[0] or None */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 519, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 519, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 519, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_5getSolution, 0, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver_getS, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_2) < 0) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 519, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 519, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_5getSolution, 0, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver_getS, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_4) < (0)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":523 * return solutions and solutions[0] or None @@ -21293,17 +21265,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * return self.recursiveBacktracking([], domains, vconstraints, {}, False) * */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 523, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 523, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 523, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_7getSolutions, 0, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver_getS_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_5) < 0) __PYX_ERR(0, 523, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 523, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 523, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_7getSolutions, 0, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver_getS_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_6) < (0)) __PYX_ERR(0, 523, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/solvers.py":428 * return [c for _, _, c in lst] @@ -21312,13 +21287,16 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Recursive problem solver with backtracking capabilities. * */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver, __pyx_t_5) < 0) __PYX_ERR(0, 428, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver, __pyx_t_6) < (0)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":527 * @@ -21327,21 +21305,21 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Problem solver based on the minimum conflicts theory. * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Problem_solver_based_on_the_mini); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3 != __pyx_t_6) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Problem_solver_based_on_the_mini); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_2 != __pyx_t_7) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 527, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":554 * """ @@ -21350,11 +21328,14 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Initialization method. * */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18MinConflictsSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[2]); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18MinConflictsSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[2]); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_7) < (0)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":566 * self._rand = rand @@ -21363,17 +21344,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * choice = self._rand.choice if self._rand is not None else random.choice * shuffle = self._rand.shuffle if self._rand is not None else random.shuffle */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18MinConflictsSolver_3getSolution, 0, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_2) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 566, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 566, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18MinConflictsSolver_3getSolution, 0, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_4) < (0)) __PYX_ERR(0, 566, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":527 * @@ -21382,13 +21366,16 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Problem solver based on the minimum conflicts theory. * */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver, __pyx_t_2) < 0) __PYX_ERR(0, 527, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4); + #endif + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver, __pyx_t_4) < (0)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":607 * @@ -21397,23 +21384,23 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Problem solver that executes all-solution solve in parallel (ProcessPool or ThreadPool mode). * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ParallelSolver, __pyx_mstate_global->__pyx_n_u_ParallelSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Problem_solver_that_executes_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__pyx_t_3 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 607, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_ParallelSolver, __pyx_mstate_global->__pyx_n_u_ParallelSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Problem_solver_that_executes_all); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_2 != __pyx_t_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 607, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); /* "constraint/solvers.py":644 * """ # noqa E501 @@ -21422,12 +21409,15 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Initialization method. Set `process_mode` to True for using ProcessPool, otherwise uses ThreadPool.""" * super().__init__() */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - PyList_Append(__pyx_t_4, __pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3]); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + PyList_Append(__pyx_t_5, __pyx_t_7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[3]); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_7) < (0)) __PYX_ERR(0, 644, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":650 * self.requires_pickling = process_mode @@ -21436,17 +21426,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Return one solution for the given problem. * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 650, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 650, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 650, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 650, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_3getSolution, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 650, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_7) < 0) __PYX_ERR(0, 650, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 650, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 650, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 650, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_3getSolution, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_8) < (0)) __PYX_ERR(0, 650, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/solvers.py":662 * raise NotImplementedError(msg) @@ -21455,17 +21448,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Parallelized all-solutions finder using ProcessPoolExecutor for work-stealing.""" * # Precompute constraints lookup per variable */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < (0)) __PYX_ERR(0, 662, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_list_tuple_Constra) < (0)) __PYX_ERR(0, 662, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < (0)) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_5getSolutionsList, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver_getSolutionsList_3, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < 0) __PYX_ERR(0, 662, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 662, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < 0) __PYX_ERR(0, 662, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_5getSolutionsList, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver_getSolutionsList_3, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_7); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolutionsList, __pyx_t_7) < (0)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutionsList, __pyx_t_6) < 0) __PYX_ERR(0, 662, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/solvers.py":688 * return solutions @@ -21474,17 +21470,20 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * return self.getSolutionsList(domains, vconstraints) * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 688, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 688, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 688, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 688, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_7getSolutions, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver_getSolutions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_7) < 0) __PYX_ERR(0, 688, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 688, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < (0)) __PYX_ERR(0, 688, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < (0)) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_7getSolutions, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver_getSolutions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_8) < (0)) __PYX_ERR(0, 688, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/solvers.py":607 * @@ -21493,15 +21492,18 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Problem solver that executes all-solution solve in parallel (ProcessPool or ThreadPool mode). * */ - __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ParallelSolver, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_4, __pyx_t_7) < 0) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ParallelSolver, __pyx_t_2, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 607, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_8); + #endif + if (__Pyx_CyFunction_InitClassCell(__pyx_t_5, __pyx_t_8) < (0)) __PYX_ERR(0, 607, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ParallelSolver, __pyx_t_8) < (0)) __PYX_ERR(0, 607, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ParallelSolver, __pyx_t_7) < 0) __PYX_ERR(0, 607, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/solvers.py":693 * ### Helper functions for parallel solver @@ -21510,18 +21512,21 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Check if all constraints are satisfied given the current assignment.""" * return all( */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_assignment, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_any) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_constraints_lookup, __pyx_mstate_global->__pyx_kp_u_list_tuple_Constraint_Hashable) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_5is_valid, 0, __pyx_mstate_global->__pyx_n_u_is_valid, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_valid, __pyx_t_5) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assignment, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_any) < (0)) __PYX_ERR(0, 693, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints_lookup, __pyx_mstate_global->__pyx_kp_u_list_tuple_Constraint_Hashable) < (0)) __PYX_ERR(0, 693, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < (0)) __PYX_ERR(0, 693, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_5is_valid, 0, __pyx_mstate_global->__pyx_n_u_is_valid, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_valid, __pyx_t_6) < (0)) __PYX_ERR(0, 693, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/solvers.py":701 * ) @@ -21530,16 +21535,19 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Compile a CompilableFunctionConstraint to a function, wrapped by a FunctionConstraint.""" * func_string = constraint._func */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint) < 0) __PYX_ERR(0, 701, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_FunctionConstraint) < 0) __PYX_ERR(0, 701, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_7compile_to_function, 0, __pyx_mstate_global->__pyx_n_u_compile_to_function, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_function, __pyx_t_3) < 0) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint) < (0)) __PYX_ERR(0, 701, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_FunctionConstraint) < (0)) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_7compile_to_function, 0, __pyx_mstate_global->__pyx_n_u_compile_to_function, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_function, __pyx_t_2) < (0)) __PYX_ERR(0, 701, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":708 * return FunctionConstraint(func) @@ -21548,19 +21556,22 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Sequential recursive backtracking function for subproblems.""" * if not unassigned_vars: */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_assignment, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_any) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_unassigned_vars, __pyx_mstate_global->__pyx_kp_u_list_Hashable) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_constraint_lookup, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_9sequential_recursive_backtrack, 0, __pyx_mstate_global->__pyx_n_u_sequential_recursive_backtrack, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sequential_recursive_backtrack, __pyx_t_5) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assignment, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_any) < (0)) __PYX_ERR(0, 708, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_unassigned_vars, __pyx_mstate_global->__pyx_kp_u_list_Hashable) < (0)) __PYX_ERR(0, 708, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < (0)) __PYX_ERR(0, 708, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraint_lookup, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_list_tuple_Constra) < (0)) __PYX_ERR(0, 708, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < (0)) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_9sequential_recursive_backtrack, 0, __pyx_mstate_global->__pyx_n_u_sequential_recursive_backtrack, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 708, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sequential_recursive_backtrack, __pyx_t_6) < (0)) __PYX_ERR(0, 708, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/solvers.py":724 * return solutions @@ -21569,19 +21580,22 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Sequential optimized backtracking (as in OptimizedBacktrackingSolver) function for subproblems.""" * # Does not do forwardcheck for simplicity */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_assignment, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_any) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_unassigned_vars, __pyx_mstate_global->__pyx_kp_u_list_Hashable) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraint_lookup, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_11sequential_optimized_backtrack, 0, __pyx_mstate_global->__pyx_n_u_sequential_optimized_backtrack, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sequential_optimized_backtrack, __pyx_t_3) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignment, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_any) < (0)) __PYX_ERR(0, 724, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_unassigned_vars, __pyx_mstate_global->__pyx_kp_u_list_Hashable) < (0)) __PYX_ERR(0, 724, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < (0)) __PYX_ERR(0, 724, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraint_lookup, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_list_tuple_Constra) < (0)) __PYX_ERR(0, 724, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < (0)) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_11sequential_optimized_backtrack, 0, __pyx_mstate_global->__pyx_n_u_sequential_optimized_backtrack, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sequential_optimized_backtrack, __pyx_t_2) < (0)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":774 * @@ -21590,37 +21604,40 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); * """Worker function for parallel execution on first variable.""" * process_mode, domains, constraint_lookup, first_var, first_value, remaining_vars = args */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_bool_dict_Hashable_Domain) < 0) __PYX_ERR(0, 774, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < 0) __PYX_ERR(0, 774, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_13parallel_worker, 0, __pyx_mstate_global->__pyx_n_u_parallel_worker, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parallel_worker, __pyx_t_5) < 0) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_bool_dict_Hashable_Domain) < (0)) __PYX_ERR(0, 774, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < (0)) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_13parallel_worker, 0, __pyx_mstate_global->__pyx_n_u_parallel_worker, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_6); + #endif + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parallel_worker, __pyx_t_6) < (0)) __PYX_ERR(0, 774, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/solvers.py":1 * """Module containing the code for the problem solvers.""" # <<<<<<<<<<<<<< * * import random */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_6) < (0)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); if (__pyx_m) { if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init constraint.solvers", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -21648,267 +21665,29 @@ __Pyx_RefNannySetupContext("PyInit_solvers", 0); #endif } /* #### Code section: pystring_table ### */ - -typedef struct { - const char *s; -#if 1520 <= 65535 - const unsigned short n; -#elif 1520 / 2 < INT_MAX - const unsigned int n; -#elif 1520 / 2 < LONG_MAX - const unsigned long n; -#else - const Py_ssize_t n; -#endif -#if 1 <= 31 - const unsigned int encoding : 5; -#elif 1 <= 255 - const unsigned char encoding; -#elif 1 <= 65535 - const unsigned short encoding; -#else - const Py_ssize_t encoding; -#endif - const unsigned int is_unicode : 1; - const unsigned int intern : 1; -} __Pyx_StringTabEntry; -static const char * const __pyx_string_tab_encodings[] = { 0 }; -static const __Pyx_StringTabEntry __pyx_string_tab[] = { - {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ - {__pyx_k_Abstract_base_class_for_solvers, sizeof(__pyx_k_Abstract_base_class_for_solvers), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Abstract_base_class_for_solvers */ - {__pyx_k_BacktrackingSolver, sizeof(__pyx_k_BacktrackingSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BacktrackingSolver */ - {__pyx_k_BacktrackingSolver___init, sizeof(__pyx_k_BacktrackingSolver___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BacktrackingSolver___init */ - {__pyx_k_BacktrackingSolver_getSolution, sizeof(__pyx_k_BacktrackingSolver_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BacktrackingSolver_getSolution */ - {__pyx_k_BacktrackingSolver_getSolutionIt, sizeof(__pyx_k_BacktrackingSolver_getSolutionIt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BacktrackingSolver_getSolutionIt */ - {__pyx_k_BacktrackingSolver_getSolutionIt_2, sizeof(__pyx_k_BacktrackingSolver_getSolutionIt_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BacktrackingSolver_getSolutionIt_2 */ - {__pyx_k_BacktrackingSolver_getSolutions, sizeof(__pyx_k_BacktrackingSolver_getSolutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BacktrackingSolver_getSolutions */ - {__pyx_k_Can_t_happen, sizeof(__pyx_k_Can_t_happen), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Can_t_happen */ - {__pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CompilableFunctionConstraint */ - {__pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint */ - {__pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain */ - {__pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionConstraint */ - {__pyx_k_FunctionType, sizeof(__pyx_k_FunctionType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionType */ - {__pyx_k_Hashable, sizeof(__pyx_k_Hashable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Hashable */ - {__pyx_k_MinConflictsSolver, sizeof(__pyx_k_MinConflictsSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinConflictsSolver */ - {__pyx_k_MinConflictsSolver___init, sizeof(__pyx_k_MinConflictsSolver___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinConflictsSolver___init */ - {__pyx_k_MinConflictsSolver_getSolution, sizeof(__pyx_k_MinConflictsSolver_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinConflictsSolver_getSolution */ - {__pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotImplementedError */ - {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ - {__pyx_k_OptimizedBacktrackingSolver, sizeof(__pyx_k_OptimizedBacktrackingSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver */ - {__pyx_k_OptimizedBacktrackingSolver___in, sizeof(__pyx_k_OptimizedBacktrackingSolver___in), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver___in */ - {__pyx_k_OptimizedBacktrackingSolver_getS, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver_getS */ - {__pyx_k_OptimizedBacktrackingSolver_getS_2, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver_getS_2 */ - {__pyx_k_OptimizedBacktrackingSolver_getS_3, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver_getS_3 */ - {__pyx_k_OptimizedBacktrackingSolver_getS_4, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_4), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver_getS_4 */ - {__pyx_k_OptimizedBacktrackingSolver_getS_5, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_5), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver_getS_5 */ - {__pyx_k_OptimizedBacktrackingSolver_getS_6, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_6), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver_getS_6 */ - {__pyx_k_ParallelSolver, sizeof(__pyx_k_ParallelSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver */ - {__pyx_k_ParallelSolver___init, sizeof(__pyx_k_ParallelSolver___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver___init */ - {__pyx_k_ParallelSolver_getSolution, sizeof(__pyx_k_ParallelSolver_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver_getSolution */ - {__pyx_k_ParallelSolver_getSolutions, sizeof(__pyx_k_ParallelSolver_getSolutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver_getSolutions */ - {__pyx_k_ParallelSolver_getSolutionsList, sizeof(__pyx_k_ParallelSolver_getSolutionsList), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver_getSolutionsList */ - {__pyx_k_ParallelSolver_getSolutionsList_2, sizeof(__pyx_k_ParallelSolver_getSolutionsList_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver_getSolutionsList_2 */ - {__pyx_k_ParallelSolver_getSolutionsList_3, sizeof(__pyx_k_ParallelSolver_getSolutionsList_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver_getSolutionsList_3 */ - {__pyx_k_Problem_solver_based_on_the_mini, sizeof(__pyx_k_Problem_solver_based_on_the_mini), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_solver_based_on_the_mini */ - {__pyx_k_Problem_solver_that_executes_all, sizeof(__pyx_k_Problem_solver_that_executes_all), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_solver_that_executes_all */ - {__pyx_k_Problem_solver_with_backtracking, sizeof(__pyx_k_Problem_solver_with_backtracking), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_solver_with_backtracking */ - {__pyx_k_Problem_solver_with_backtracking_2, sizeof(__pyx_k_Problem_solver_with_backtracking_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_solver_with_backtracking_2 */ - {__pyx_k_ProcessPoolExecutor, sizeof(__pyx_k_ProcessPoolExecutor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ProcessPoolExecutor */ - {__pyx_k_RecursiveBacktrackingSolver, sizeof(__pyx_k_RecursiveBacktrackingSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RecursiveBacktrackingSolver */ - {__pyx_k_RecursiveBacktrackingSolver___in, sizeof(__pyx_k_RecursiveBacktrackingSolver___in), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RecursiveBacktrackingSolver___in */ - {__pyx_k_RecursiveBacktrackingSolver_getS, sizeof(__pyx_k_RecursiveBacktrackingSolver_getS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RecursiveBacktrackingSolver_getS */ - {__pyx_k_RecursiveBacktrackingSolver_getS_2, sizeof(__pyx_k_RecursiveBacktrackingSolver_getS_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RecursiveBacktrackingSolver_getS_2 */ - {__pyx_k_RecursiveBacktrackingSolver_recu, sizeof(__pyx_k_RecursiveBacktrackingSolver_recu), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RecursiveBacktrackingSolver_recu */ - {__pyx_k_RecursiveBacktrackingSolver_recu_2, sizeof(__pyx_k_RecursiveBacktrackingSolver_recu_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RecursiveBacktrackingSolver_recu_2 */ - {__pyx_k_Recursive_problem_solver_with_ba, sizeof(__pyx_k_Recursive_problem_solver_with_ba), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Recursive_problem_solver_with_ba */ - {__pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RuntimeError */ - {__pyx_k_Solver, sizeof(__pyx_k_Solver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Solver */ - {__pyx_k_Solver_getSolution, sizeof(__pyx_k_Solver_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Solver_getSolution */ - {__pyx_k_Solver_getSolutionIter, sizeof(__pyx_k_Solver_getSolutionIter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Solver_getSolutionIter */ - {__pyx_k_Solver_getSolutions, sizeof(__pyx_k_Solver_getSolutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Solver_getSolutions */ - {__pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StopIteration */ - {__pyx_k_ThreadPoolExecutor, sizeof(__pyx_k_ThreadPoolExecutor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ThreadPoolExecutor */ - {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ - {__pyx_k__5, sizeof(__pyx_k__5), 0, 1, 1}, /* PyObject cname: __pyx_n_u__5 */ - {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ - {__pyx_k_append, sizeof(__pyx_k_append), 0, 1, 1}, /* PyObject cname: __pyx_n_u_append */ - {__pyx_k_arcconstraints, sizeof(__pyx_k_arcconstraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arcconstraints */ - {__pyx_k_arcs, sizeof(__pyx_k_arcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arcs */ - {__pyx_k_arcsvariable, sizeof(__pyx_k_arcsvariable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arcsvariable */ - {__pyx_k_args, sizeof(__pyx_k_args), 0, 1, 1}, /* PyObject cname: __pyx_n_u_args */ - {__pyx_k_assignment, sizeof(__pyx_k_assignment), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assignment */ - {__pyx_k_assignments, sizeof(__pyx_k_assignments), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assignments */ - {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */ - {__pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bool */ - {__pyx_k_c, sizeof(__pyx_k_c), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c */ - {__pyx_k_check, sizeof(__pyx_k_check), 0, 1, 1}, /* PyObject cname: __pyx_n_u_check */ - {__pyx_k_choice, sizeof(__pyx_k_choice), 0, 1, 1}, /* PyObject cname: __pyx_n_u_choice */ - {__pyx_k_chunksize, sizeof(__pyx_k_chunksize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_chunksize */ - {__pyx_k_class, sizeof(__pyx_k_class), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class */ - {__pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class_getitem */ - {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ - {__pyx_k_close, sizeof(__pyx_k_close), 0, 1, 1}, /* PyObject cname: __pyx_n_u_close */ - {__pyx_k_co_consts, sizeof(__pyx_k_co_consts), 0, 1, 1}, /* PyObject cname: __pyx_n_u_co_consts */ - {__pyx_k_code_object, sizeof(__pyx_k_code_object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_code_object */ - {__pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_collections_abc */ - {__pyx_k_compile, sizeof(__pyx_k_compile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compile */ - {__pyx_k_compile_to_function, sizeof(__pyx_k_compile_to_function), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compile_to_function */ - {__pyx_k_concurrent_futures, sizeof(__pyx_k_concurrent_futures), 0, 1, 1}, /* PyObject cname: __pyx_n_u_concurrent_futures */ - {__pyx_k_conflicted, sizeof(__pyx_k_conflicted), 0, 1, 1}, /* PyObject cname: __pyx_n_u_conflicted */ - {__pyx_k_constraint, sizeof(__pyx_k_constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint */ - {__pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_constraints */ - {__pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_domain */ - {__pyx_k_constraint_lookup, sizeof(__pyx_k_constraint_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_lookup */ - {__pyx_k_constraint_solvers, sizeof(__pyx_k_constraint_solvers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_solvers */ - {__pyx_k_constraint_solvers_py, sizeof(__pyx_k_constraint_solvers_py), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_constraint_solvers_py */ - {__pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraints */ - {__pyx_k_constraints_lookup, sizeof(__pyx_k_constraints_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraints_lookup */ - {__pyx_k_copy, sizeof(__pyx_k_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_copy */ - {__pyx_k_count, sizeof(__pyx_k_count), 0, 1, 1}, /* PyObject cname: __pyx_n_u_count */ - {__pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict */ - {__pyx_k_dict_Hashable_Domain, sizeof(__pyx_k_dict_Hashable_Domain), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_dict_Hashable_Domain */ - {__pyx_k_dict_Hashable_any, sizeof(__pyx_k_dict_Hashable_any), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_dict_Hashable_any */ - {__pyx_k_dict_Hashable_list_tuple_Constra, sizeof(__pyx_k_dict_Hashable_list_tuple_Constra), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_dict_Hashable_list_tuple_Constra */ - {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */ - {__pyx_k_doArc8, sizeof(__pyx_k_doArc8), 0, 1, 1}, /* PyObject cname: __pyx_n_u_doArc8 */ - {__pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_doc */ - {__pyx_k_doesn_t_provide_iteration, sizeof(__pyx_k_doesn_t_provide_iteration), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_doesn_t_provide_iteration */ - {__pyx_k_domain, sizeof(__pyx_k_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domain */ - {__pyx_k_domains, sizeof(__pyx_k_domains), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domains */ - {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */ - {__pyx_k_enter, sizeof(__pyx_k_enter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_enter */ - {__pyx_k_exec, sizeof(__pyx_k_exec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exec */ - {__pyx_k_executor, sizeof(__pyx_k_executor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_executor */ - {__pyx_k_exit, sizeof(__pyx_k_exit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exit */ - {__pyx_k_first_value, sizeof(__pyx_k_first_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_first_value */ - {__pyx_k_first_var, sizeof(__pyx_k_first_var), 0, 1, 1}, /* PyObject cname: __pyx_n_u_first_var */ - {__pyx_k_forwardcheck, sizeof(__pyx_k_forwardcheck), 0, 1, 1}, /* PyObject cname: __pyx_n_u_forwardcheck */ - {__pyx_k_forwardcheck_2, sizeof(__pyx_k_forwardcheck_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_forwardcheck_2 */ - {__pyx_k_fromkeys, sizeof(__pyx_k_fromkeys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fromkeys */ - {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */ - {__pyx_k_func_2, sizeof(__pyx_k_func_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_2 */ - {__pyx_k_func_3, sizeof(__pyx_k_func_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_3 */ - {__pyx_k_func_string, sizeof(__pyx_k_func_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_string */ - {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */ - {__pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_genexpr */ - {__pyx_k_get, sizeof(__pyx_k_get), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get */ - {__pyx_k_getArcs, sizeof(__pyx_k_getArcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getArcs */ - {__pyx_k_getSolution, sizeof(__pyx_k_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolution */ - {__pyx_k_getSolutionIter, sizeof(__pyx_k_getSolutionIter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutionIter */ - {__pyx_k_getSolutions, sizeof(__pyx_k_getSolutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutions */ - {__pyx_k_getSolutionsList, sizeof(__pyx_k_getSolutionsList), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutionsList */ - {__pyx_k_getSortedVariables, sizeof(__pyx_k_getSortedVariables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSortedVariables */ - {__pyx_k_hideValue, sizeof(__pyx_k_hideValue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hideValue */ - {__pyx_k_init, sizeof(__pyx_k_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_init */ - {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */ - {__pyx_k_is_an_abstract_class, sizeof(__pyx_k_is_an_abstract_class), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_is_an_abstract_class */ - {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */ - {__pyx_k_is_valid, sizeof(__pyx_k_is_valid), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_valid */ - {__pyx_k_is_valid_locals_genexpr, sizeof(__pyx_k_is_valid_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_valid_locals_genexpr */ - {__pyx_k_is_valid_locals_genexpr_locals_g, sizeof(__pyx_k_is_valid_locals_genexpr_locals_g), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_valid_locals_genexpr_locals_g */ - {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */ - {__pyx_k_item, sizeof(__pyx_k_item), 0, 1, 1}, /* PyObject cname: __pyx_n_u_item */ - {__pyx_k_items, sizeof(__pyx_k_items), 0, 1, 1}, /* PyObject cname: __pyx_n_u_items */ - {__pyx_k_iter, sizeof(__pyx_k_iter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_iter */ - {__pyx_k_key, sizeof(__pyx_k_key), 0, 1, 1}, /* PyObject cname: __pyx_n_u_key */ - {__pyx_k_keys, sizeof(__pyx_k_keys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keys */ - {__pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lambda */ - {__pyx_k_list, sizeof(__pyx_k_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_list */ - {__pyx_k_list_Hashable, sizeof(__pyx_k_list_Hashable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_Hashable */ - {__pyx_k_list_dict_Hashable_any, sizeof(__pyx_k_list_dict_Hashable_any), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_dict_Hashable_any */ - {__pyx_k_list_tuple, sizeof(__pyx_k_list_tuple), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_tuple */ - {__pyx_k_list_tuple_Constraint_Hashable, sizeof(__pyx_k_list_tuple_Constraint_Hashable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_tuple_Constraint_Hashable */ - {__pyx_k_local_assignment, sizeof(__pyx_k_local_assignment), 0, 1, 1}, /* PyObject cname: __pyx_n_u_local_assignment */ - {__pyx_k_lst, sizeof(__pyx_k_lst), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lst */ - {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ - {__pyx_k_map, sizeof(__pyx_k_map), 0, 1, 1}, /* PyObject cname: __pyx_n_u_map */ - {__pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaclass */ - {__pyx_k_mincount, sizeof(__pyx_k_mincount), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mincount */ - {__pyx_k_minvalues, sizeof(__pyx_k_minvalues), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minvalues */ - {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ - {__pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mro_entries */ - {__pyx_k_msg, sizeof(__pyx_k_msg), 0, 1, 1}, /* PyObject cname: __pyx_n_u_msg */ - {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ - {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */ - {__pyx_k_only_provides_all_solutions, sizeof(__pyx_k_only_provides_all_solutions), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_only_provides_all_solutions */ - {__pyx_k_otherdomain, sizeof(__pyx_k_otherdomain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_otherdomain */ - {__pyx_k_othervalue, sizeof(__pyx_k_othervalue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_othervalue */ - {__pyx_k_othervariable, sizeof(__pyx_k_othervariable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_othervariable */ - {__pyx_k_parallel_pool, sizeof(__pyx_k_parallel_pool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parallel_pool */ - {__pyx_k_parallel_worker, sizeof(__pyx_k_parallel_worker), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parallel_worker */ - {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ - {__pyx_k_popState, sizeof(__pyx_k_popState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_popState */ - {__pyx_k_popitem, sizeof(__pyx_k_popitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_popitem */ - {__pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prepare */ - {__pyx_k_process_mode, sizeof(__pyx_k_process_mode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_process_mode */ - {__pyx_k_process_mode_2, sizeof(__pyx_k_process_mode_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_process_mode_2 */ - {__pyx_k_provides_only_a_single_solution, sizeof(__pyx_k_provides_only_a_single_solution), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_provides_only_a_single_solution */ - {__pyx_k_pushState, sizeof(__pyx_k_pushState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pushState */ - {__pyx_k_pushdomains, sizeof(__pyx_k_pushdomains), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pushdomains */ - {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ - {__pyx_k_queue, sizeof(__pyx_k_queue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_queue */ - {__pyx_k_rand, sizeof(__pyx_k_rand), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rand */ - {__pyx_k_rand_2, sizeof(__pyx_k_rand_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rand_2 */ - {__pyx_k_random, sizeof(__pyx_k_random), 0, 1, 1}, /* PyObject cname: __pyx_n_u_random */ - {__pyx_k_range, sizeof(__pyx_k_range), 0, 1, 1}, /* PyObject cname: __pyx_n_u_range */ - {__pyx_k_recursiveBacktracking, sizeof(__pyx_k_recursiveBacktracking), 0, 1, 1}, /* PyObject cname: __pyx_n_u_recursiveBacktracking */ - {__pyx_k_remaining_vars, sizeof(__pyx_k_remaining_vars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_remaining_vars */ - {__pyx_k_requires_pickling, sizeof(__pyx_k_requires_pickling), 0, 1, 1}, /* PyObject cname: __pyx_n_u_requires_pickling */ - {__pyx_k_result, sizeof(__pyx_k_result), 0, 1, 1}, /* PyObject cname: __pyx_n_u_result */ - {__pyx_k_results, sizeof(__pyx_k_results), 0, 1, 1}, /* PyObject cname: __pyx_n_u_results */ - {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */ - {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */ - {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */ - {__pyx_k_sequential_optimized_backtrack, sizeof(__pyx_k_sequential_optimized_backtrack), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sequential_optimized_backtrack */ - {__pyx_k_sequential_recursive_backtrack, sizeof(__pyx_k_sequential_recursive_backtrack), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sequential_recursive_backtrack */ - {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */ - {__pyx_k_setdefault, sizeof(__pyx_k_setdefault), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setdefault */ - {__pyx_k_shuffle, sizeof(__pyx_k_shuffle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shuffle */ - {__pyx_k_single, sizeof(__pyx_k_single), 0, 1, 1}, /* PyObject cname: __pyx_n_u_single */ - {__pyx_k_solutions, sizeof(__pyx_k_solutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solutions */ - {__pyx_k_sort, sizeof(__pyx_k_sort), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sort */ - {__pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sorted */ - {__pyx_k_sorted_variables, sizeof(__pyx_k_sorted_variables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sorted_variables */ - {__pyx_k_sorted_vars, sizeof(__pyx_k_sorted_vars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sorted_vars */ - {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */ - {__pyx_k_steps, sizeof(__pyx_k_steps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_steps */ - {__pyx_k_steps_2, sizeof(__pyx_k_steps_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_steps_2 */ - {__pyx_k_string, sizeof(__pyx_k_string), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_string */ - {__pyx_k_super, sizeof(__pyx_k_super), 0, 1, 1}, /* PyObject cname: __pyx_n_u_super */ - {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ - {__pyx_k_throw, sizeof(__pyx_k_throw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_throw */ - {__pyx_k_tuple_bool_dict_Hashable_Domain, sizeof(__pyx_k_tuple_bool_dict_Hashable_Domain), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_tuple_bool_dict_Hashable_Domain */ - {__pyx_k_types, sizeof(__pyx_k_types), 0, 1, 1}, /* PyObject cname: __pyx_n_u_types */ - {__pyx_k_unassigned_vars, sizeof(__pyx_k_unassigned_vars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unassigned_vars */ - {__pyx_k_v, sizeof(__pyx_k_v), 0, 1, 1}, /* PyObject cname: __pyx_n_u_v */ - {__pyx_k_val, sizeof(__pyx_k_val), 0, 1, 1}, /* PyObject cname: __pyx_n_u_val */ - {__pyx_k_vals, sizeof(__pyx_k_vals), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vals */ - {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ - {__pyx_k_values, sizeof(__pyx_k_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_values */ - {__pyx_k_var, sizeof(__pyx_k_var), 0, 1, 1}, /* PyObject cname: __pyx_n_u_var */ - {__pyx_k_variable, sizeof(__pyx_k_variable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable */ - {__pyx_k_variable1, sizeof(__pyx_k_variable1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable1 */ - {__pyx_k_variable2, sizeof(__pyx_k_variable2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable2 */ - {__pyx_k_variables, sizeof(__pyx_k_variables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables */ - {__pyx_k_vars_involved, sizeof(__pyx_k_vars_involved), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vars_involved */ - {__pyx_k_vconstraints, sizeof(__pyx_k_vconstraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vconstraints */ - {__pyx_k_x, sizeof(__pyx_k_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x */ - {0, 0, 0, 0, 0} -}; -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); - /* #### Code section: cached_builtins ### */ static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 87, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 221, __pyx_L1_error) - __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 227, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 573, __pyx_L1_error) __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_super); if (!__pyx_builtin_super) __PYX_ERR(0, 646, __pyx_L1_error) __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 668, __pyx_L1_error) __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 704, __pyx_L1_error) + + /* Cached unbound methods */ + __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get; + __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items; + __pyx_mstate->__pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_keys.method_name = &__pyx_mstate->__pyx_n_u_keys; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; + __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values; + __pyx_mstate->__pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; + __pyx_mstate->__pyx_umethod_PyList_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; + __pyx_mstate->__pyx_umethod_PyList_Type__copy.type = (PyObject*)(&PyList_Type); + __pyx_mstate->__pyx_umethod_PyList_Type__copy.method_name = &__pyx_mstate->__pyx_n_u_copy; return 0; __pyx_L1_error:; return -1; @@ -21974,6 +21753,52 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, ((PyObject*)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_tuple; + for (Py_ssize_t i=0; i<4; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_slice; + for (Py_ssize_t i=0; i<1; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -21984,42 +21809,142 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get; - __pyx_mstate->__pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_keys.method_name = &__pyx_mstate->__pyx_n_u_keys; - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; - __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; - __pyx_mstate->__pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; - __pyx_mstate->__pyx_umethod_PyList_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; - __pyx_mstate->__pyx_umethod_PyList_Type__copy.type = (PyObject*)(&PyList_Type); - __pyx_mstate->__pyx_umethod_PyList_Type__copy.method_name = &__pyx_mstate->__pyx_n_u_copy; - if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_mstate->__pyx_int_1000 = PyLong_FromLong(1000); if (unlikely(!__pyx_mstate->__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error) + { + const struct { const unsigned int length: 11; } index[] = {{1},{32},{12},{179},{825},{1476},{768},{991},{818},{1},{8},{21},{22},{19},{49},{7},{26},{6},{2},{21},{9},{14},{25},{11},{33},{28},{32},{8},{117},{18},{27},{30},{34},{52},{31},{28},{10},{6},{18},{12},{8},{18},{27},{30},{27},{36},{43},{64},{44},{40},{39},{46},{14},{23},{26},{27},{48},{49},{31},{19},{20},{27},{36},{39},{40},{67},{49},{6},{18},{22},{19},{18},{1},{12},{6},{14},{4},{12},{4},{10},{11},{18},{4},{1},{5},{6},{9},{9},{17},{18},{5},{9},{11},{15},{7},{19},{18},{10},{10},{22},{17},{17},{18},{11},{18},{4},{5},{4},{6},{7},{6},{7},{9},{4},{8},{8},{11},{9},{12},{13},{8},{8},{5},{4},{11},{7},{3},{7},{11},{15},{12},{16},{18},{9},{8},{13},{8},{25},{42},{4},{5},{4},{3},{4},{8},{4},{16},{3},{8},{3},{13},{8},{9},{10},{15},{3},{8},{4},{11},{10},{13},{13},{15},{3},{8},{7},{11},{12},{13},{9},{11},{12},{5},{4},{5},{6},{21},{14},{17},{6},{7},{6},{4},{4},{30},{30},{12},{10},{7},{6},{9},{4},{6},{16},{11},{5},{6},{5},{8},{5},{5},{15},{1},{3},{4},{5},{6},{3},{8},{9},{9},{9},{13},{12},{1},{23},{255},{14},{49},{319},{37},{48},{53},{37},{32},{26},{32},{107},{14},{296},{29},{57},{243},{167},{12},{37},{245},{146},{186},{2},{2},{14},{78},{15},{30}}; + #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (3657 bytes) */ +const char* const cstring = "(\265/\375`?)\375q\000\372\210\004\035G\340\316\272\0010\314\3634\204\3015\234\347i\010\003a \014\204\301\265\020\006k\240\016\273\314\224\311\246d\031\304c9z\016d6\215\324\276\217\230yW8z\310\013\251.q\267R\234\2603\215\354\334\355\214\351M\255F\372[\225\001\234\001\336\001\331Z\032n\306/'Q]Yo\254\223o\247i~\267\335\001\267\255\2656\230\257xA\224\2543\267\264\261\177\366\326j\370\336\273W\320\206\273\250/N\207\025\344\270\322\354\r_tj\035\357\3241\264:\265\366\331;\323+j\377j\353\366\330\266\226q\261.\250m\240\275\2736S\267\256\241\3261\316\357\267\252\341\335VD\251\374\366\361\273<\327\342\312\257\006cn\310\253\315 \326\251-[\357\375\222\257-\246\205\325\271\rk\030\332\257\366|\277\316\265mUs>;\273\237\275\343\236\311\270r\333\355\330\265\002o\337\254\225L\2778#\313\245\316j\313\254\266l\265\340\314f\303U\317\370\346eS[7$3\222\332\"\261$6+n\361\2664 h],\326J&C\306 Vb\306\215\003\225\352r\271Z7,\0073\325\252\266X\257\332RY\325\312\306\246V\250=\034\271\213\213K\013\277\241h\263\322S\271\275\002\220\364d\206L\2172\365\241\263@\304\304\331\240\307\257x\004\037\251Ee\250\310\t\342\003%+ae\215\210\351e\266P\361\010L\273\016\324\016\344\003\344\314iI\241'\024\205\251Q~\200\371\022i*\2450\362Er\224\327\357\224@J\251%;\310\227\327\231:Y`\312\222/\245!\377ag\311\003>0\272\023\224\345\334`\216\314\017\236\026\362a\240\313@=N\225\t\226\023<\r\211\222\231%&/mi\302\243|O\316\200\217\211O\210nZ\323\365\3615\220(R:B\366e\020>\204\222_2\372%j~\r\315\337\361\261>*>!\272W\216\300\310\224\276\310\2363i\204<\244!\363Vz\330\311L\230yR\226\214\220\244@\002~\026\230\24432\337\2463\20168OgO\271R\226T\020U$=\241\022V\377V\252DBx\221\217\364Fz\240R\230Y*o^\001\212\306\307\220(\323\356fKY\211\263{\231)\223\205\267>\201)\r\2252\336E\316@)M\231'\023E*\363#\245\017\363/\337I\017Rz\362!\357A\236H\251F)\275\231\031L\t%\200\362\201\337@J\310\021 E\360\2274!7Hi*\2271J_%+\2472\025\032\221\3230\375\374S\371\3429\374':\360s\323a\324\345\344\237""\214\276-MJ\233\023y\302\3047\021\373\261\013\377\202\013\305\300\327}8_\247\n\311'1\361\274 \005\330\021\351\350\210r\026\315f\242\024)D55\"\017\036B5\034\233\177\"\366\025\350B\272\013(\377\236\007\024\354n\243\024\346\217\2409\246\013\301g\211hD$H \010\001\375Y\211_\202\303\377\200\276\320\t#\277\003e\360\252?\002\013\231\"70\314\006e\206\322#;F\033>eA\1771`\264\013\225+H\014dM\256\000\306\013M\241-\254oM\223\217]\n\022:5\230c\211}\002\362\200IC9zL\002\301\205\312:\032\245)\222#\000\000\031\200\030\200\230\350\304\211\224\237\002\242i\371-\252\257\332\235@|\206\356\004\2059WJ@_#\017\224\030\370\020\215\364\246\333\240\362\273\231\362\361Anf\n\271\001\322q\322\315\240(\364\345\254\241\225*\026=\277\207\177\256\277\316\3719\264O\273\377\332oI|\022\261\177\363\t\3050D\033\273\233\016%M\211|\354\322\021\221\217\024v\216\316\007&\253$\201\021\330\3554J;\330\003\323\355t\276\230\010\312P\351\341CN R:Rn\360\022v\030\244]\352t\240\340\227&\244\021\014\320\307\217\010F\364\362\022\022\021\302\023\370\240)3[J\002\024^g\213\022EuBn\214v2\335\013\350sl\244\001F;\221\007Q\007Q\207\220\006\201~2\206\217\001\344\203\200<\240f|\213\315\211\177\343\343\002\305\347\204\023\324\35785\3501\245V\304\004Q\236\370\020Tj}\207\233,f\367\322m@IP~\362\230\013T\312T\311\342S>d\267I;\231\031\300\264\3610_C\0368\371\001^\206t\300A\026\203-\2502\303\026\205\314\320\214\310H\222$\205\306B\030\014\022\n\303HX\325\354\022\262\240\303 b\306\030BDFDD\002\031\221 \222\224\024\244\224\306S\0017R\370\304\001\204\274%\232b\001B\375?\270\363@\313\233\343\375i\204\347r&\364\312\227\242=\320z\200l\243\230\003\245\265\266\306\016\202INd\360\222\222\223\270\252\017\031\374=\342@\023\220]\320V%s\207o\323\240\265\r\364\325\371v,_\355x\024\2100\275\2074\232\253\211\366\002\304!\360\204m$]j\320G8N\222\320\225\340\352\235$*H-\253U\320\205}\231yJV\340Z\202/G\257Lj\332H\246%\n\324\340\3341\001\n<$xjj\010|S\314\022\002\366\273\005\272M\313\262>C\361\254n\325\320\276A\023p\224\242\203\026&\210\026D\351:m\330\363,&u""\302\255;\211\014E\035\0374\344wNa\271N r.6\r;\004\304\320sAP\2137\014G\362&\323\326\232~p\227\323\006\032\370\270\205\211\223\302\330\rb\223)\3266X\324\020\266GH\020\305\343v\n\005f\014|[*\022\260V\034r\367\010S\361\374\253\247\377\034\301v\367I\213\201\024\\q}\315N\3723\346\253\230\377\377\303<-l\274U\3554\227\215R\024\254\260\207\177\017k\020(\261h\261\323jQ\330\336\201\032\245\036\377\227\362\025n'\305m\325\315\2269 \014(&i\237*\n\277\320.&\243\276l\024\203\210\252'\311\205\315\214\335\326\307\341G\261\255\273w\312d\323\266$pd\235PDF@\312!\026\010'0\326\215\020\243\357\266@n\213\005\364\370XZ>\304\322\024\312E7\r;VL\272\206\264\006}\274Xa9\245\256\037]\357\241%\267O;\236\303\014(\315;R\251d\3116\271\306\201\230\3652\250\215D\354\370\3430\336\233x\374\224\260K\2461\243\341i\001\177;\365=\204\323\321\265-I\020%\027\217B\247\351\346\230^x\313\317\236\353\3009\321\226\020p\312\037\310\315B\275\213\n\277\275?\3637H\251\222\3556s\310\217\022W\001\027\361\021\306\200\255\316\271u\234,\322\007J\020zg\204\240%\274\342\342\220\276\247g\025O\363\021\345\025T)\224\315\3044(p\250\014B\343\225RX(\340\260\346BQ\335\214Q \003\332\364`f\373\200\230\343B\r\r8\214\336\363I\203\337\313\230\002\243D\3374\356E\267\373\020\314w\354[S\330\006\023\230)(\201I\2353E\013d\027,\302\372T\222:\00159\001\206G\371#@7Q\260\007\334\200\341\363#\353\331\350\027HQ\372X\311\014&\030\025\213\227qJu\243>\274\331\021)\314\306\211\340\317j\014\263\330\370\347'\305\rv\242\237\367D\241\2035\236C(1\024\371c\266\027\304\321'3\300\327\2437\250\374\201H\3117\324\001\032\357\360#\256`\353\"\312\306\302\270\246\371\240\006\006,ul\2041\366\377\211VE \307\315\303\374^F\021\341-\r\246\366\350l\227\367\261\320\276f\037s#\205\221K\031\021\227\324\246\014Ry,Y\211\261?P-\243\376\226\233\300\255\237 \352\327f\201\323\207\215/\033\017Yy\033\223\310\250\013q\341\253\372\337\002\256\345\222D1\010,\375\337X,#+$\216\335\016\005\302\223\272\3304i\023\004\000\034\342\214\312\215\202\322}[\303(\237\246\231cX\274\272V{)#\353""\036\260\210\323x\226\020\354iAE\022A\3104\003z\337\202:A\247\345\216\311\352\tX\275p\311\206\260\263\032\354\276\230'G\337a\346\330\261\254\n\243\250\004\330\033\322\201\016\253\252\026\177%?\301\325$\021\023\214\223\020\250\376r\2322\2536f\352T:~c\277-3\251Z\263\362\031\027F\317\357\030\346p\220\226Sm^,-hT\266>\236S\002p\365\356\370\013\210\206\360P\014C\032\217\343?\326\325d*\373\025\313\036\007\017\016\364\214\224\334\256b\360\3547M(H*\010\243\0135Q\3373vI\323\357\352n&\226\317\245\303s\367\010\256U\265\360X\016\273\235\327e\333\027G+v\370\353.W{i[_\016\250\035\225;Q\037n`v\222G\024b\333\007\357\007V\240\001J}\022\363i\3155\357\007\230\323\3079L\271ky9\216\014n\347N\335\247qO(\032\033*i4)y%\374\010\272\021\206\200\345\256\252\252w\253\265\241\177\355\000\327h\036t\373\271\303\357b\276Y\003\246\235\211\r):\304t\227\342\034\263HZ\235\377\202\310\352`0\326B\363\"`\304PG4\345\003\001E\374\321\225\335|\2230-\333\032\341\017\347\347\340\275,\240\274\334\276\366\022NT\310\350\242\347\013\241\267\265+\253l\267\374\013\276\371\263\0008:\313\255,P\n\312\227I\224\t\030>)>oM\227}6\202\370\031CP\257J\362\305\022\300\304\360.\227\365>'\320]\242\2114\341\373\207\254`q\243\000\262D\340\250\361\303%\204P\367\313\027\017\304\335W\232?\365\342I-\177\372%\220\242\3011\2703\376,v\211%\350\354\355\342\033:\013\261""\027\330\210i\350\001\313\370,t\na\371\013\341\331\\\340\212Y`?\327\366\3737\237\230\357s\203\\\253\022(\310\244\007\321\037oi\200\254\324\t\367T9\220\367U|\326L\227\005=\3057\235|3\213\033\363\326\231D}\300\342B!{\221W\260\177\222\351\210\234i\260\232\200\002\221\301\000\375\036\335\301@\224/fcb\223\205\007(4\277/\263w`\224&\306Lb\257\331\026E\034Y\000\010S1\025\2148xcSO0\321\r\345x\352\021+yjg}\306\r\235\372\224J\037\254<\352UB\360r\205qu\237\372\034:)E\276\304q\220\254V"; + PyObject *data = __Pyx_DecompressString(cstring, 3657, 3); + if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) + const char* const bytes = __Pyx_PyBytes_AsString(data); + #if !CYTHON_ASSUME_SAFE_MACROS + if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } + #endif + #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (3854 bytes) */ +const char* const cstring = "BZh91AY&SY\206\"\267\270\000\005\035\177\377\377\377\377\377\377\377\277\377\377\377\377\377\377\377\377\375@@@@@@@@@@@@@\000@\000`\017\277{f\207\017\223>\335\326\324\355\336\367\013{\273Z\002\200K\246\212\000W^\207T+\267\317\210\000\343\260\2254\"D\336\244\361'\250\033&\241\352\003\312yO\320L2D\031\r0\232\r\003F\232hi\352z\236\2404\320\311\221\243A\241\352\t$!\221\240#T\312~\246\215O\322j\231\262\243\036\211\224\374\250\364z\247\251\352zh\214\230\000M1\241&b\023EZ\032\006\206\221\274\"\320S\257\365\375\366\254\347\340\251\203\360\367\257\356\235\002;h\327^\310>\2429\227\230\254r\362\327\274;\235m[\210\207>\354\3449]e)\214\321\316\020+\034\310\212\222\306PB\321\220\244E\363X\311\357E\010\252\253\035\030\032\335d\345\200\2446\\\210\325N\\(\353ugO\013\243k\342\277BF\3427\021\336\003\256#Y*\274\021\367\355p\2039\000`g\347\026\372\023V\250R\002\025\014%B\322a\367\3655\254U\034k\255\324\341`g\002\3453O`\351C\203\006x\010\204\315ip\320\203\355N\026\267m+7\222\\s'\322\202\030\317\014B\331\275\361\266q\336+#\315Q\265\234\232\267\373\364\231\313Jdq\237l\341\334\265\020G\202H\344\313k\177\3339\027\354hvY\021\356\364N{|t\023\330,`\265\316a\260u\250\322:\361\020--\277G\"\202\201\371B\020T\206\312\036<\036\264;+\r\276^\336Q\273\220\350b\214_\\\214SWU\373z!#\247\023I\353\343\260\206'\031\264\347c\266\206Cm\315I)5\325\237\343\260Z\031\031\243=\225\236\315\020<\240{\333S\210\014\252\\\247\272H\321\275\243n""\215\2336\372\3737\274\010\372!\232bA\321wTn\0246\341\243\007)FN\004\222L\210t\350D\313O\026\306\304k\021X&\212\275\271 \343V\311igt)Y\320\254\"e\001,Qz\367\327\240\t\332\272\306\013\020+\321@\0205\030\375x\355{M%zPW\326\355Y\032\361P\260\241\365\362\221\276\216r=\301\017F\312\335\001\310s\244\301,\016\300\341\330\034B\361Q\341G\246\"RGV$\214a\247\343\233\211\016\336\216\316\247\234\033\314\367\030@w\034\035\2526\371\335\207\027\204\361\002\0221\010T\215\227\301\221\\\225f\247\326:U1\206\327\3527u!!\225\314\211RB\207h\200i\250u\235\250\346I\223\224\023\317\0053\023V-\223#\311\345\037Y\000\3336\2047\214\222`\036\215:T\370\222\373\311\270N\274d(\317`\276\006\257]\022l\000h\376I\t\357\310\265\0038\217f\371WrM\242\311\013\207#\361(F\0011'\366\2518`w\352x\030\265\240\324\271Q\277\203\376y\244\263.M\332&\251\235]^\221\334\020\316.#\356\025e\360\351\247k\rhm07\022\363\320\266U\243f9\364\314_\ny\216\22563\030P\377\341c\311\316\273\207\214\350:\031/\367\351{e\253kz.\342\236\210\373\335\356\216@\356@\216\262K\314\230m\027\024\003g\313\231\345\240\335%{\0044\010h^N\234\217\3558\270\351\"^wO\232\255\325\r\003\\\335ZR\302\313B.\001\314\231\330\354\276\375\nPP6\322J\303\020\030\353\216\014\211\3165c\273\316}\255:#K\273\3374\246\233\352\2462v\374\353hqH\216\205\211\222V\262\241\016NJR\220\203\223\230\205&\230\322'B\020o!\242J\021\000\347\013Z\010\270\225\022*\033\001\263\rl\211\004\031n\361I\326)+\245=\020\215\021\214\262\3550\264\262\212s\365\226\243\224H\277\202\255\361\310\203\206\233Bsc\235\n\350\225\210\265\021\332d\033\255\"VH\215\316M\"\326\273\233\006]\252\342\355W\331HfBh\356\306Y\326z\326\336\344\245\017\326l\006\257\t\350\356\357^l\300E\0200\0334;:\313\r\006\257\005\251\253<\204\262\266\022@\206N\005\032\332F\235V\276\010\352\243}\026\275\213\245\234\202\036l'\225sfM\342KB,\3468j\023CM\t66\231\232.\345\230R\220s\325L\272\362\221\003\301\034\211\334\322\302X\351s8\301\335\210\016\262\204\004\237*\362\020\206\306\327>\346\215%T]\225\266\272\364w\033%\314\345\362\371\231""\267\335\26560\233\265s\355\002\221\032\nn\3217\3421\271\216\026\330$\032Y\324\031\261\251\244\246\321F!\260\314\311\305\364\370\215p\003'\264\353v.\r\346 \3238\034\000\304\033X%\010b\206\240m\371\021\254I2\321\213\026n$\233\212$C(&\204\301o\311\322\246\014\247+\324\241j\304\332Zw\024\225\256\232ogwB\002h\203zn\354\246\216\3206\206!45\330\3132,L\r7\337\352\"\014\234\204\240\270v\020lI\024% \340\341\362\351f\234h\2174\226\251\316\223\351A\022\235\034\334\365\210a$\272\356\032\325\016\021\253""\257@(\004\356D\\'\016\2212W\312\352\302\245\324\t\356\340\2126\313k\324\362\325#,6\350\354w\264\032\271#i\312\273\246\205C\261\306A\001\370\276NB\204\350\007\002\336\375\"\034\017`;\035HG\260-X\344\355\214\263\222CM4\236\364\370v\212\210\332\221\301j\226/\316\252\215E\002\025\307\025/y!\004k\330ye\323\357\371\253{\t$\250t\246\206\177Q\031\"\231EP\320\302\320BRjh\221\333\232\004\\)$\365%\005g\0035D\255\334\035\245W\022\304\254h\021D4Q\322\361'Q\316\271\004\271w\355gM\301n6\215\230z\346\232\265\017xjHX\032\254\024\210\255e\352\367=B\210-\2545P\016\312\025\323\214~DT\035\251\031\003\311\324\302\003\340\217\037=\340\354\312\213^\242\032\311f&)\004N\232\0032\257\304\276T\320\032h\272\013\021\206\no\300\213\231\227\001\351-&\333\006(e\322\337\216\366\270\324S\321\202)$\031\024\301\200\241/\234'Y0\220\270\n^\377\316~\022l\254k\367\032\373\346j7\254?\253\\\324&\242\3715\315M\231\355b \257\347\037%\245\311\341\363\300\330\346\274%*,S\206z\016\014tW3ew{\372\330cp\342\013\375t6+\032^W\032\225U\264k\253\367\2300\355\330\200\267\002\275\366`,\232\014\334nR\ri8 \256\177\216\246\216+\216\210CYV\223Zj\302\300\275\234\304\273b\273\216\300\345\373bm\273f\024\313\027eu\327`\271\355h\304\370\325K\005\006X@\335mT+\335^R\017\325\031m\214*T\371T>TN\362S\245XB\224\312o\253\350\376g\303\215G7f\343\215\2100_2\235\033\254\212\204\347\262\267\030O?\035W\351\261\257\325\231h}Q\213E+\277JeD\300\033I\256Q\243\236\211V\204\376\016y;\035\225v\t\370\336I""\323T\211B\031\323y\350\316\357#\235\014n\347\025R\371\250LW\216\337;/#\241\212JV\034\251r\351}\360\214(l\314h\335\354\267\214\234\025\340\367d\311\223\365\255's\0377~_\364t\266\246\241\214h\222\364l\221\342F\215\310\213/!\323J9|\376&\362\036\014\314\273\311\016\361\035v\203\031\371\274\274j\357D\316\307f\353\263\321\310W\261^\273\330B\341\214>f\342\356\361'x\nr3\002P\250L\350\310Y\240\366\027P\221\270\020\250\305*\372t\344h\221u\367\327\341\356Qb\231\266\243\315\222O\203O\247\241\372\037441\366\362\363\253\252\372g\000d\014\\\350\3568\306\327\363E\032\323\005\232\254\225\036dl\313V\200\330\352v\331\327[#M\225\250\031iF\233\204\224 s\017\013\347\214\251\314\325\r\302\241\254\341\352\235\263\201\020r$6f\354B4\204\366*\034R\245Y\311\241\335\357\036q\025\t\034*ir\242Y\023i\243\326\223\261Z\327H\213!\027k+F\262Hx\030\r\n\034\351\307\253pu\214\007\013\262\337Jb\330\264\2730\256\352&\352z]y\323EW\325\037\022L\246\274\357\374]\311\024\341BB\030\212\336\340"; + PyObject *data = __Pyx_DecompressString(cstring, 3854, 2); + if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) + const char* const bytes = __Pyx_PyBytes_AsString(data); + #if !CYTHON_ASSUME_SAFE_MACROS + if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } + #endif + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (3668 bytes) */ +const char* const cstring = "x\332\355YKw\323\326\026\216\323\320:\020J\014\001\022\010\027%\244M\002\211\263\014\264@\332r\233B\240\024Jc\010\244\220\246\252,\035\307jl\311\226\344%\244&\247\204\211\361\014JW'W\246Z}\223\311\244\320\376\333\323\367\332\241}\257v\366]9\272C\211b\323\252/\204\246}\023\337\252\332\235\310\214\247\334\326\211\311\311\375\306$%Ey.\031\252\204\007sbyT\032\235\022F3\243+S\302r\n\223b\266\2257\216\303\014D\026U\263&\362R!\243H\2024%df\205\214p\233Jma\223;\325\005\370er\024\364\215\244\2552\353i\263vbrWg\303b\312D4&\251Z\254`\302\030\001<\t\301ou_4\312l_`:\305\233\035\362\027\301t\226\221\3445a\242\240\233\026\344\311L\263\004Y\312\347\005\220\314\232\234\355\364I\253\014\336? *\024\320\231)\363\206\241\033\263\302^\304i\366uU!jk\010\006I0\301\312\340\341I\270\035\307\313G\361\177}\241k\231\372OH\374Mv\251\177\340\036\360\0002\034\262!\3747\234+\342\365\212u\254\034\321A_qKQek\371k\tos0fJ\270\313\337\255Wv\325J\332\326\356\252\274jZ\313V\031j.\267\2313%D\035VV0\300\244\322\233\265c\032\265\257\312\374\025Z\023\244\350P\222\037\375\251f\330\254\360\211Zb\371\323>\332\255\264\365Y9T\265\203\366\371\207\235\347|\036\276\207\336\016\345g\360\222;%\354\217\341\236\372\303!k?p\253\232C\332\035\366\372~oMR\024\261\331\260Dq\237\246\016\252\036\334JD>\274G\362s~\224b\336F\201\247\214\333\007\2171\357\360S\000\262e\3571@\273\024\342\267\267GT\263\270Ud\021&{\217\270\366\326\264\020\331\247\251C\273\003v \0074\265\204\037\324g\027n\207v\245|\325\312\343{Q~\313\251\314G`\317\333\366}\313~\357\246\372\316\027\327\235O-\340vUwL\366\346\026\363\200&\262\272\215\331*\323\330f\321x\353\376\021\306\207\014\3508\344\232\347\007\244\272\001K\2666""\361\177\027\364\022\037\263M\353\t\313\036\220\265\017hjAsP\237\016\215\336\262\233yP?c\277\266\275\260\274\263\210\260m\2572\373G\306>J\267\3178\333@\213\315\357@\014%\372F\245H\206\334q0\210'\376\037\235\tK\306\252IK\312*?Em\227P\271\245\311\252\216\027.C\307l\0323)\241\313r\216\311krNWe&\347\312\332\032\035M\213\"_\2260w\263\000\035i#A\217\030\010\207\211V\264\334\313y\335\304j+r\225LYW\230\250g\350S\230\254\203Rr\370\366'e\344\346\241h\363&Z\272\230m\2468\214\004\226\006\235\371f\313V\031\273\224\350{\025S\332\206\266K\311\016\353;j\303\223\362v\205\230\327\365\265r\261\243Gs#\260\357p\263\325\275\270%\353e\315\242\365L\321\347\014\371\246(*\272L\027\222\337<\304\027E\332\257\300;\364\305\200\265|\3056\211\311Y\3250-\221\037\343GEz\215\336\220\014\205\243-v>d\r\275\260\306\266 \221\360\020\303[\364/\206\013p3\256\341\005\374\240\222\331\301\231]\244\352d\323\3568\336\233\263rX\374\237\223\236Q\020\212\252)\266\010\2022\214P\225\350\276'\321\274\261aoO\260\207oEiC\004s\311\342(\314h\335\347\335\3056[\363@M$\244\351Z\304\005/\373MN\026\310\311p\020\356\034b\252\322\22528\205\277\202\241\223g\014\225W\233\253\242\250I\005\264@\tK\247\357\030\241\377x\221\217n\226B<\242O\030b\021\221\321z\330\320\241\261Q\324\213\370=\245@\304=\214\206\242AC\030\025\332\337\034v<\024\313f.\034\203B\213;\245\262\224\017\365*\225Y\031;DM\021\351B\377za\337\324b\260Bx\256Bd2\rV*\253\010\0241\372l\020n\355\303+Z\021E\232\311\362Y\223>\300\240/\035\371\000\337\326\207\037\261\365\356\330\321\332\232\267\335*\212&\263\232\020\242\324\374\350b\346\312\331,\330\3037\213\255\315$\275y\204o\037\341Ul}\245j?\233&\2200E~5\313E\n \213\221\253\255\234\241o\360\217\344e-dAs\300:\274\204\237\311\235\025\372\033\325\221\350\350\236\212\nW[\223\322`\220z\235\177\006[\357\010\364M\277\347\254\375\253\233z}\262\253\367x\345\033[\n\342}\225\007v\332\357J\330\027}\341Z\365Vm\356\365\321\256#\307+w\355^'\341L\272\251\240\347he$\210\237\264\307l\346\334\304s\374X\345\226}\337\371\304}\317\275\345\335\361J""A\337\361 \236\260\317:1'\021\304\317\332\226\223r\346 \327\357\273\340\244\003\\~\360\022\336H\320w\242\362\233\363\324\215\005\375\377r$\347\027o\304K5P\\u\323\256D\215\245F\377\200\375\300y\216\031\006.:%\267\317\233\013\006\316\332\245`p\330y\214\361\303\343n\311\237\270UK\004\303\002\032\277EA\270\344^w_U\023\325+\265\027\365\202\377t1\030\373\350\365\373]#\243\270\\\270\344^\366\346\274t\003\303\037\272%\017\363\016\330\017!7\206\306\343\375\025\313N\005\375$\276\347X%U?\267}m[\332\336\360\237/\371K\337\373=\227\374K\237\372\237\246\375\364\223 >`\337\365\007\223\236\344Y\000\347\361\366\33060;Qy\345\0148/\\\3115\275K^z\347\200\204=`?w>s\025o\274z\266v\264\376\361v,\204/\353<\362z\274\373\325\033\265\313\365{\333\300\364\214-5\200\377#'\026\364A\025\247\317\275\007XnTG\252)\362\313\274}\332\226\010\316\240o\010\320\366\221\014\311\336p\030 \352;e\247\354\271\240\257\337\356s\346\010\271G\356q\357\207Z\2426B\240Y\316,`]\253\016\341qp\2501p\272\321\177\336\271\006\330\177\365R\200\265\177\030\016\342h/\271sn\272\003oj\030\030\204\"\337V\207k\351\232\024\014\236w\256;\257\340\300+\325\027x\034\376\210\272\237\265\327\271'\007G\334\263^\314K\004C\027\035\303M\004\203\227\240\031\360~\200NQ\033\315\234\202\341\357\003\301R\320\317)q\242\215>\240,u\302G\304p\020\303\t\n\2573\366\2223\347,{G\2744wF#N\310\033\224\037\210\2670""\245\021&\n\022\007\023\3169#\316\rw\304\275\006\205>\3626\253fm\264v\277\236jPC\203g(\222\227\216\242\204\317Y\"\006\177\343H\301\3009\347\262\333\014\205o\275a\230*\005\3754\337+Xq%t3B\000z%N\373\003\227a\361gU\265\366\333\366\212\377r\231:\316:\213\340\356\300y\212\263\235b)\373a\366\207\234W\234\251]C\376\320W\376W\332\353\256.=\366M7n\337t?\354n\364\034\tN\236\362\273\340\335\371z\272\321s\322\276\2148\302m\034)t\332\375\025\341\014\314?\207\230c\356\254\227\366\024\202\025U\3761\204\203\003Z\300\347\217!\353\273\330<\211\234\357\276\327\375z\260\253\367\002\245Q\n\2308\370\023\304\021\211\376\305\253H\016\310\321\215xo#\214}\262\340\226s\337\205\211\027x8\203g\001\254\215w%\3169g\335\230{\336\233\257&B@J\241\225\375d\331'HEs\215\276\343\215\260\245\201\250?\206x\232#\273\2214F\335I\357\223jOu\2162@*\030\276\020Dy\2641\210lA`\0167\343Z\251\216\004oN@\323\365R\203\247 \342\305I\254\022\335\344\255}M~\277\253w!\266]\362\027\236\371\317$_b>\313\372\3315\177M\367u\3237_\371\257~\241.\343n\026\301\273T\235\257\r\324\026\353D\267\336\323ab\017\342C!\255\251\356\244\r\262\315x\244i\357\220?8\343Y\376\265\373\365Rp\374\234\3631\350\327w\306\3169\n\202\371\322\365\352=\344c\316\237\243\260\274\177\210\243\226h\204\231i\334\037\237\365g\241\320\363\316\362\233sC\327\214?\203\036!A^\222i/\273\027\336\303m\341\275\364{p\312\221S\366H\320\303\327\035\312\351=\002t\3519\322Z\005NT\266\3020\n\265\030\302\272\207\210\212\357\212\250\216\374\t;T\247\354\336\205_\210\022\274\245\021\255tA?V\230`\340_\216\352\226\275\273\325Xs=\035\n\"g7\210\017\344\230\301\346\3523\006\362\204\201\344O\316\326Fj\251\375\")\014\362\336\017+K\366W\366\317n\354`\243\033=\037\374nUx\242-\001\341\217`\035v\0243\316I\320\252\347\264-\272w\\\324\\\361x\256\353\215\266\021'\355\021\373\006\334\201\374p\2232\206/\244\220\215>\256\001\243\323\004\205\177\341\263Z\252\366\310\377\372{\377{p%Cq\212\355Ls=\367\273\316a\366\363\317H\225g\335\317\273)$'\375\363Io\255v\301\277Gk|\320\303! \345J\r\276\326^\244)""\316TK\264cI\363m\t\243\324\350O\177Y\217\325/\372\013/\221.\374\345UH\314\305\036\222\340\207\335Kt[\352\376\221n?vg\350\226\351\326\350\246u\257\323m\275{\203h}$\376\373&\310\324?\352\217^\253\246\252\217\352\224M\374\023\323\3309$\277\364\277\\\360\027^\370/^r\315\355\004\014_&\002\272c\330^ \336\374\236\313\376\345\3335\265^z}\346\277\310\321\204z76\016\262s\312\231w\023\264\377+\275\356\307\356\217o\317\370c#~\274\362\004\304\213\2656mt\007\237\377\003\372\224\240Y"; + PyObject *data = __Pyx_DecompressString(cstring, 3668, 1); + if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) + const char* const bytes = __Pyx_PyBytes_AsString(data); + #if !CYTHON_ASSUME_SAFE_MACROS + if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } + #endif + #else /* compression: none (10815 bytes) */ +const char* const bytes = ".Abstract base class for solvers.Can't happenNote that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.Problem solver based on the minimum conflicts theory.\n\n Examples:\n >>> result = [[('a', 1), ('b', 2)],\n ... [('a', 1), ('b', 3)],\n ... [('a', 2), ('b', 3)]]\n\n >>> problem = Problem(MinConflictsSolver())\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(lambda a, b: b > a, [\"a\", \"b\"])\n\n >>> solution = problem.getSolution()\n >>> sorted(solution.items()) in result\n True\n\n >>> problem.getSolutions()\n Traceback (most recent call last):\n ...\n NotImplementedError: MinConflictsSolver provides only a single solution\n\n >>> problem.getSolutionIter()\n Traceback (most recent call last):\n ...\n NotImplementedError: MinConflictsSolver doesn't provide iteration\n Problem solver that executes all-solution solve in parallel (ProcessPool or ThreadPool mode).\n\n Sorts the domains on size, creating jobs for each value in the domain with the most variables.\n Each leaf job is solved locally with either optimized backtracking or recursion.\n Whether this is actually faster than non-parallel solving depends on your problem, and hardware and software environment. \n\n Uses ThreadPool by default. Instantiate with process_mode=True to use ProcessPool. \n In ProcessPool mode, the jobs do not share memory.\n In ProcessPool mode, precompiled FunctionConstraints are not allowed due to pickling, use string constraints instead.\n\n Examples:\n >>> result = [[('a', 1), ('b', 2)],\n ... [('a', 1), ('b', 3)],\n ... [('a', 2), ('b', 3)]]\n\n >>> problem = Problem(ParallelSolver())\n >>>"" problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(\"b > a\", [\"a\", \"b\"])\n\n >>> for solution in problem.getSolutions():\n ... sorted(solution.items()) in result\n True\n True\n True\n\n >>> problem.getSolution()\n Traceback (most recent call last):\n ...\n NotImplementedError: ParallelSolver only provides all solutions\n\n >>> problem.getSolutionIter()\n Traceback (most recent call last):\n ...\n NotImplementedError: ParallelSolver doesn't provide iteration\n Problem solver with backtracking capabilities.\n\n Examples:\n >>> result = [[('a', 1), ('b', 2)],\n ... [('a', 1), ('b', 3)],\n ... [('a', 2), ('b', 3)]]\n\n >>> problem = Problem(BacktrackingSolver())\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(lambda a, b: b > a, [\"a\", \"b\"])\n\n >>> solution = problem.getSolution()\n >>> sorted(solution.items()) in result\n True\n\n >>> for solution in problem.getSolutionIter():\n ... sorted(solution.items()) in result\n True\n True\n True\n\n >>> for solution in problem.getSolutions():\n ... sorted(solution.items()) in result\n True\n True\n True\n Problem solver with backtracking capabilities, implementing several optimizations for increased performance.\n\n Optimizations are especially in obtaining all solutions.\n View https://github.com/python-constraint/python-constraint/pull/76 for more details.\n\n Examples:\n >>> result = [[('a', 1), ('b', 2)],\n ... [('a', 1), ('b', 3)],\n ... [('a', 2), ('b', 3)]]\n\n >>> problem = Problem(OptimizedBacktrackingSolver())\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(lambda a, b: b > a, [""\"a\", \"b\"])\n\n >>> solution = problem.getSolution()\n >>> sorted(solution.items()) in result\n True\n\n >>> for solution in problem.getSolutionIter():\n ... sorted(solution.items()) in result\n True\n True\n True\n\n >>> for solution in problem.getSolutions():\n ... sorted(solution.items()) in result\n True\n True\n True\n Recursive problem solver with backtracking capabilities.\n\n Examples:\n >>> result = [[('a', 1), ('b', 2)],\n ... [('a', 1), ('b', 3)],\n ... [('a', 2), ('b', 3)]]\n\n >>> problem = Problem(RecursiveBacktrackingSolver())\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(lambda a, b: b > a, [\"a\", \"b\"])\n\n >>> solution = problem.getSolution()\n >>> sorted(solution.items()) in result\n True\n\n >>> for solution in problem.getSolutions():\n ... sorted(solution.items()) in result\n True\n True\n True\n\n >>> problem.getSolutionIter()\n Traceback (most recent call last):\n ...\n NotImplementedError: RecursiveBacktrackingSolver doesn't provide iteration\n ?add_noteconstraint/solvers.pydict[Hashable, Domain]dict[Hashable, any]dict[Hashable, list[tuple[Constraint, Hashable]]]disable doesn't provide iterationenablegc is an abstract classisenabledlist[Hashable]list[dict[Hashable, any]]list[tuple]list[tuple[Constraint, Hashable]] only provides all solutions provides only a single solutiontuple[bool, dict[Hashable, Domain], dict[Hashable, list[tuple[Constraint, Hashable]]], Hashable, any, list[Hashable]]BacktrackingSolverBacktrackingSolver.__init__BacktrackingSolver.getSolutionBacktrackingSolver.getSolutionIterBacktrackingSolver.getSolutionIter..BacktrackingSolver.getSolutionsCompilableFunctionConstraintConstraintDomainFunctionConstraintFunct""ionTypeHashableMinConflictsSolverMinConflictsSolver.__init__MinConflictsSolver.getSolutionOptimizedBacktrackingSolverOptimizedBacktrackingSolver.__init__OptimizedBacktrackingSolver.getSolutionIterOptimizedBacktrackingSolver.getSortedVariables..OptimizedBacktrackingSolver.getSolutionsListOptimizedBacktrackingSolver.getSolutionsOptimizedBacktrackingSolver.getSolutionOptimizedBacktrackingSolver.getSortedVariablesParallelSolverParallelSolver.__init__ParallelSolver.getSolutionParallelSolver.getSolutionsParallelSolver.getSolutionsList..genexprParallelSolver.getSolutionsList..ParallelSolver.getSolutionsListProcessPoolExecutor__Pyx_PyDict_NextRefRecursiveBacktrackingSolverRecursiveBacktrackingSolver.__init__RecursiveBacktrackingSolver.getSolutionRecursiveBacktrackingSolver.getSolutionsRecursiveBacktrackingSolver.recursiveBacktracking..RecursiveBacktrackingSolver.recursiveBacktrackingSolverSolver.getSolutionSolver.getSolutionIterSolver.getSolutionsThreadPoolExecutor___annotate__appendarcconstraintsarcsarcsvariableargsassignmentassignmentsasyncio.coroutinesboolccheckchoicechunksize__class____class_getitem__cline_in_tracebackcloseco_constscode_objectcollections.abccompilecompile_to_functionconcurrent.futuresconflictedconstraintconstraint.constraintsconstraint.domainconstraint_lookupconstraint.solversconstraintsconstraints_lookupcopycountdictdoArc8__doc__domaindomains__enter__execexecutor__exit__first_valuefirst_varforwardcheck_forwardcheckfromkeys__func___funcfuncfunc_stringgenexprgetgetArcsgetSolutiongetSolutionItergetSolutionsgetSolutionsListgetSortedVariableshideValue__init___is_coroutineis_validis_valid..genexpris_valid..genexpr..genexpritemitemsiterkeykeyslistlocal_assignmentlst__main__map__metaclass__mincountminvalues__module____mro_entries__msg__name__nextotherdomainothervalueothervariableparallel_poolparallel_workerpoppopStatepopitem__prepare__process_mode_process_modepushStatepushd""omains__qualname__queuerand_randrandomrecursiveBacktrackingremaining_varsrequires_picklingresultresultsreturnselfsendsequential_optimized_backtracksequential_recursive_backtrack__set_name__setdefaultshufflesinglesolutionssortsortedsorted_variablessorted_varssteps_stepssuper__test__throwtypesunassigned_varsvvalvalsvaluevaluesvarvariablevariable1variable2variablesvars_involvedvconstraintsx\320\004\027\220|\2401\360\022\000\t\r\210J\220a\330\010\014\210I\220Q\320\000\021\220\037\320 3\2609\270A\360\n\000\005\r\210D\220\t\230\021\230)\2401\330\004\n\210!\330\010\022\220$\220e\2308\2401\330\010\013\2109\220G\2305\240\003\2409\250C\250q\330\014\r\330\010\021\220\027\230\001\230\021\330\010\027\220t\2301\230A\330\010\014\320\014\035\230Q\330\014\035\230\\\250\021\250!\330\014\017\210~\230S\240\001\330\020\036\230a\230{\250!\2501\340\020\036\230g\240Q\240a\330\014\017\210q\340\020\024\220I\230V\2401\330\024\037\230q\240\014\250A\330\024\027\220q\330\030\034\230N\250!\330\034'\240q\320(9\270\021\330\034 \240\014\250M\270\021\330 #\2404\240z\260\021\260+\270Y\300m\320ST\330$%\360\006\000!\"\360\006\000\035#\240*\250A\250Q\340\030\034\230K\240q\250\001\330\020\024\220K\230q\240\001\360\006\000\r\020\210t\2201\330\020\027\220q\330\004\013\2101\300\032\3103\310a\310w\320VW\320WX\320\004#\320#6\3206Q\320QR\330\010\024\220D\320\030.\250a\250t\2609\270N\310$\310a\330\010\017\210z\230\024\230Y\240a\240s\250#\250Q\320\004#\320#6\3206Q\320QR\330\010\021\220\024\220V\230;\240d\250'\260\027\270\n\300&\310\001\330\010\022\220$\220f\230L\250\004\250G\2607\270*\300F\310!\330\010\026\220a\340\010\014\210L\230\001\330\014\027\220q\230\014\240F\250!\2507\260!\2601\330\010\014\210E\220\025\220a\220t\2301\330\014\031\230\021\330\014\022\220$\220a\220w\230e\2401\330\014\023\2201\220A\330\014\020\220\014\230A\340\020\024\220L\240\r\250\\\270\021\270!\330\024\027\220t\230:\240Q\240k\260\031\270!\330\030\031\340\024\025\340\020\033\2303\230a\230|\2501\250A\330\020\034\230A\330\020\024\220I\230W""\240A\240Q\330\024\037\230q\240\014\250A\330\024\034\230A\330\024\030\230\014\240M\260\034\270Q\270a\330\030\033\2304\230z\250\021\250+\260Y\270a\330\034%\240Q\330\024\027\220v\230S\240\001\330\030!\240\027\250\001\250\021\330\031\037\230r\240\021\330\030#\2401\330\030\034\230I\240Q\330\030!\240\027\250\001\250\021\340\020\033\2301\230L\250\006\250a\250q\330\020\035\230Q\330\014\017\210t\2201\330\020\027\220q\330\010\017\210q\320\004#\320#6\3206Q\320QR\360\022\000\t\017\210b\220\001\220\024\220Z\230q\330\010\016\320\016!\240\021\240!\320\004#\320#6\3206Q\320QR\330\010\017\210t\320\023#\2401\240I\250]\270!\330\010\t\330\014\023\2204\220q\230\001\330\017\020\330\014\023\2201\320\004$\320$7\3207R\320RS\330\010\013\2104\210q\330\014\023\2204\220q\230\004\320\034,\250A\250Y\260m\3001\330\010\017\210t\320\023$\240A\240Y\250a\320\004$\320$7\3207R\320RS\360\022\000\t\017\210b\220\001\220\024\220Z\230q\330\010\016\320\016!\240\021\240!\320\004$\320$7\3207R\320RS\330\010\017\210t\2201\220D\320\030(\250\001\250\031\260-\270q\320\004$\320$7\3207R\320RS\330\010\017\210t\320\023$\240A\240Y\250a\320\004$\320$7\3207R\320RS\330\010\017\210t\320\023)\250\021\250$\250i\260~\300T\310\021\320\000\025\320\025(\320(8\270\001\360\n\000\005\014\2101\330\004\010\210\005\210Q\330\010\024\220L\240\001\330\010\013\2103\210a\210{\230#\230Q\330\014\027\220|\2401\330\014\020\220\013\2301\230K\240s\250+\260Q\260k\300\023\300G\3101\310A\330\014\020\220\013\2301\230K\240s\250+\260Q\260k\300\023\300G\3101\310A\330\004\013\2101\230\033\240A\240Q\240d\250!\2501\250A\200A\360\032\000\t\017\210b\220\001\220\023\220A\220\\\240\021\240,\250c\260\021\260'\270\021\270,\300j\320PT\320T`\320`a\330\010\013\2105\220\001\220\024\220Q\330\010\014\210H\220A\330\014\017\210t\2202\220S\230\007\230q\340\020\021\360\006\000\r\026\220W\230A\230[\250\005\250Q\330\014\023\2201\340\010\023\2204\220r\230\021\330\010\023\2201\220L\240\001\340\010\027\220t\2301\330\010\013\2101\330\014\032\230!\2307\240!\2403\240d\250%\250x""\260s\270\"\270G\3001\340\014\032\230!\340\010\014\210I\220W\230A\230Q\330\014\027\220q\230\014\240A\330\014\017\210q\330\020\024\220J\230a\330\024\032\230*\240A\330\014\020\220\014\230M\250\034\260Q\260a\330\020\023\2204\220z\240\021\240+\250Y\260m\3001\340\024\025\360\006\000\021\025\320\024*\250!\250;\260i\270~\310]\320Z[\330\020\023\220:\230T\240\021\330\024\033\2301\330\014\017\210q\330\020\024\220J\230a\330\024\032\230)\2401\330\010\014\210K\220q\230\001\330\010\017\210q\320\000\031\320\031B\320Bn\360\000\000o\001J\002\360\000\000J\002K\002\340\004\005\330\022\023\320\000$\320$E\300Q\340\004\022\220*\230A\330\004\022\220'\230\021\230-\240|\2601\330\004\013\210<\220q\230\013\240:\250Q\250d\260'\270\021\330\004\013\320\013\035\230Q\230a\320\004(\320(N\360\000\000O\001E\002\360\000\000E\002F\002\360\030\000\t\035\230A\330\010\035\230Q\330\010$\240A\330\010\033\2304\320\0372\260!\2609\270A\340\010\t\340\014\020\220\014\230A\330\020\023\2209\230G\2401\340\024\035\230W\240A\240Y\250a\330\024\025\360\010\000\021\032\230\027\240\001\240\033\250E\260\021\330\020\023\2204\220q\330\024\033\2301\330\020\032\230)\2405\250\004\250A\340\014\r\340\020\023\2204\220q\340\024\030\230\013\2401\240A\330\024\032\230!\330\030\"\240)\2505\260\004\260A\330\030\033\2301\330\034\035\330\030\034\230K\240q\250\001\340\030\037\230q\360\006\000\021\034\2301\230L\250\006\250d\260!\330\020\024\220L\240\r\250\\\270\021\270!\330\024\027\220t\230:\240Q\240k\260\031\270-\300q\340\030\031\340\024\025\360\006\000\r\022\220\027\230\002\230*\240A\320\004(\320(N\360\000\000O\001E\002\360\000\000E\002F\002\360\006\000\tP\001\310q\320PU\320Ua\320ae\320ef\320fk\320ko\320os\320sz\320z{\360\006\000\t'\240f\250A\250W\260E\270\024\270T\300\021\360\006\000\t\025\220K\230q\240\001\330\010\031\230\033\240A\240Q\360\006\000\t\022\220\021\330\010/\250q\360\006\000\t\031\320\030/\250t\3203G\300q\330\r\032\230&\240\001\340\014\026\220h\230d\240!\320#4\260F\270*\300A\330\014\020\220\n\230!\330\020\031\230\027\240""\001\240\021\340\010\017\210q\320\004'\320':\320:U\320UV\320\004'\320':\320:U\320UV\360\022\000\t\017\210b\220\001\220\024\220Z\230q\330\010\016\320\016!\240\021\240!\320\000/\320/U\320Un\360\000\000o\001Z\002\360\000\000Z\002P\003\360\000\000P\003Q\003\360\010\000\005\023\220!\330\004\027\220q\330\004\031\230\021\330\004 \240\001\340\004\005\340\010\014\210L\230\001\330\014\017\210y\230\007\230q\340\020\031\230\027\240\001\240\031\250!\330\020\021\360\010\000\r\026\220W\230A\230[\250\005\250Q\330\014\017\210t\2201\330\020\027\220q\330\014\026\220i\230u\240D\250\001\340\010\t\340\014\017\210t\2201\340\020\024\220K\230q\240\001\330\020\026\220a\330\024\036\230i\240u\250D\260\001\330\024\027\220q\330\030\031\330\024\030\230\013\2401\240A\340\024\033\2301\360\006\000\r\030\220q\230\014\240F\250$\250a\330\014\020\220\014\230M\320):\270!\2701\330\020\023\2204\220z\240\021\240+\250Y\260m\3001\340\024\025\340\020\021\360\006\000\t\016\210W\220B\220j\240\001\320\000/\320/U\320Un\360\000\000o\001Z\002\360\000\000Z\002P\003\360\000\000P\003Q\003\340\004\007\200t\2101\330\010\017\210q\220\n\230%\230q\340\004\n\210/\230\022\2301\330\004\025\220_\240C\240q\340\004+\2501\330\004\010\210\t\220\027\230\001\230\021\330\010\022\220!\2207\230!\330\010\013\2108\2201\220L\320 1\260\021\260&\270\001\330\014\025\220W\230A\320\035;\2701\270L\320HX\320Xa\320ab\330\010\014\210J\220a\220q\330\004\013\2101\320\000\032\360\000\000\033U\002\360\000\000U\002V\002\340\004\022\220)\320\033.\250k\270\035\320FW\320WX\330\004\030\230\013\2401\340\004\007\200q\340\010\014\210E\220\037\320 1\260\026\260q\330\014\035\230Q\230g\240Q\240e\2501\250A\320-@\300\001\300\037\320PZ\320Z[\320[g\360\000\000h\001K\002\360\000\000K\002W\002\360\000\000W\002^\002\360\000\000^\002b\002\360\000\000b\002n\002\360\000\000n\002v\002\360\000\000v\002w\002\360\006\000\005\010\200x\210q\320\020\"\320\"3\2601\260L\300\001\330\010\017\320\017-\250Q\320.@\320@P\320PY\320YZ\330\004\013\2101\220\021\220!\220[\240\001\240\021\240$""\240a\240q\250\001\320\004*\320*>\270i\300q\360\026\000\t\017\210b\220\001\220\023\220A\220\\\240\021\240,\250c\260\021\260'\270\021\270,\300j\320PT\320T`\320`a\330\010\013\2105\220\001\220\024\220Q\330\010\017\210q\220\002\220$\220c\230\023\230E\240\021\320\004\027\220q\360\020\000\t\r\320\014\035\230Q\320\004\027\220q\340\010\r\210R\210y\230\001\330\010\014\320\014\035\230Q\330\010\014\320\014!\240\021"; + PyObject *data = NULL; + CYTHON_UNUSED_VAR(__Pyx_DecompressString); + #endif + PyObject **stringtab = __pyx_mstate->__pyx_string_tab; + Py_ssize_t pos = 0; + for (int i = 0; i < 215; i++) { + Py_ssize_t bytes_length = index[i].length; + PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL); + if (likely(string) && i >= 29) PyUnicode_InternInPlace(&string); + if (unlikely(!string)) { + Py_XDECREF(data); + __PYX_ERR(0, 1, __pyx_L1_error) + } + stringtab[i] = string; + pos += bytes_length; + } + for (int i = 215; i < 245; i++) { + Py_ssize_t bytes_length = index[i].length; + PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); + stringtab[i] = string; + pos += bytes_length; + if (unlikely(!string)) { + Py_XDECREF(data); + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + Py_XDECREF(data); + for (Py_ssize_t i = 0; i < 245; i++) { + if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { + __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = stringtab + 215; + for (Py_ssize_t i=0; i<30; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif + } + { + PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0; + int8_t const cint_constants_1[] = {0,1}; + int16_t const cint_constants_2[] = {1000}; + for (int i = 0; i < 3; i++) { + numbertab[i] = PyLong_FromLong((i < 2 ? cint_constants_1[i - 0] : cint_constants_2[i - 2])); + if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #if CYTHON_IMMORTAL_CONSTANTS + { + PyObject **table = __pyx_mstate->__pyx_number_tab; + for (Py_ssize_t i=0; i<3; ++i) { + #if PY_VERSION_HEX >= 0x030F0000 + PyUnstable_SetImmortal(table[i]); + #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break; + #if PY_VERSION_HEX < 0x030E0000 + if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1) + #else + if (PyUnstable_Object_IsUniquelyReferenced(table[i])) + #endif + { + Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1)); + } + #else + if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break; + Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT); + #endif + } + } + #endif return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_codeobjects ### */ -\ - typedef struct { - unsigned int argcount : 3; - unsigned int num_posonly_args : 1; - unsigned int num_kwonly_args : 1; - unsigned int nlocals : 5; - unsigned int flags : 10; - unsigned int first_line : 10; - unsigned int line_table_length : 13; - } __Pyx_PyCode_New_function_description; +typedef struct { + unsigned int argcount : 3; + unsigned int num_posonly_args : 1; + unsigned int num_kwonly_args : 1; + unsigned int nlocals : 5; + unsigned int flags : 10; + unsigned int first_line : 10; +} __Pyx_PyCode_New_function_description; /* NewCodeObj.proto */ static PyObject* __Pyx_PyCode_New( const __Pyx_PyCode_New_function_description descr, PyObject * const *varnames, PyObject *filename, PyObject *funcname, - const char *line_table, + PyObject *line_table, PyObject *tuple_dedup_map ); @@ -22028,189 +21953,189 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { PyObject* tuple_dedup_map = PyDict_New(); if (unlikely(!tuple_dedup_map)) return -1; { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 153, 12}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 153}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_queue, __pyx_mstate->__pyx_n_u_lst, __pyx_mstate->__pyx_n_u_item, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_pushdomains, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_x}; - __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionIter, __pyx_k_UUV, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionIter, __pyx_mstate->__pyx_kp_b_iso88591_UUV, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 162, 14}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 162}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_x}; - __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_lambda, __pyx_k_AQd_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_lambda, __pyx_mstate->__pyx_kp_b_iso88591_AQd_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 276, 12}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 276}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_sorted_variables, __pyx_mstate->__pyx_n_u_queue, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_pushdomains, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_x}; - __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionIter, __pyx_k_UUV, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionIter, __pyx_mstate->__pyx_kp_b_iso88591_UUV, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 425, 14}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 425}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_x}; - __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_lambda, __pyx_k_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_lambda, __pyx_mstate->__pyx_kp_b_iso88591_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 480, 14}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 480}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_x}; - __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_lambda, __pyx_k_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_lambda, __pyx_mstate->__pyx_kp_b_iso88591_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 675, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 675}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_val}; - __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 668, 14}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 668}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_v}; - __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_lambda, __pyx_k_3awVWWX, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_lambda, __pyx_mstate->__pyx_kp_b_iso88591_3awVWWX, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 698, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 698}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_v}; - __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 696, 2}; + const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 696}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_vars_involved, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 13, 107}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 13}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_arcs, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_variable1, __pyx_mstate->__pyx_n_u_variable2}; - __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getArcs, __pyx_k_8_1_Q_L_3a_Q_1_1Ks_Qk_G1A_1Ks_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getArcs, __pyx_mstate->__pyx_kp_b_iso88591_8_1_Q_L_3a_Q_1_1Ks_Qk_G1A_1Ks_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 28, 255}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 28}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_arcs, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_check, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u__5, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_arcsvariable, __pyx_mstate->__pyx_n_u_othervariable, __pyx_mstate->__pyx_n_u_arcconstraints, __pyx_mstate->__pyx_n_u_otherdomain, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_othervalue, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables}; - __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_doArc8, __pyx_k_39A_D_1_e81_9G5_9Cq_t1A_Q_S_a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_doArc8, __pyx_mstate->__pyx_kp_b_iso88591_39A_D_1_e81_9G5_9Cq_t1A_Q_S_a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 77, 37}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 77}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_msg}; - __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_66QQR_b_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_mstate->__pyx_kp_b_iso88591_66QQR_b_Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 89, 37}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 89}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_msg}; - __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_k_77RRS_b_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_mstate->__pyx_kp_b_iso88591_77RRS_b_Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 101, 37}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 101}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_msg}; - __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionIter, __pyx_k_UUV_b_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionIter, __pyx_mstate->__pyx_kp_b_iso88591_UUV_b_Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 143, 15}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 143}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_forwardcheck}; - __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 223, 48}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 223}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_iter}; - __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_66QQR_t_1I_4q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_mstate->__pyx_kp_b_iso88591_66QQR_t_1I_4q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 230, 32}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 230}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints}; - __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_k_77RRS_t1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_mstate->__pyx_kp_b_iso88591_77RRS_t1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 266, 15}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 266}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_forwardcheck}; - __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 344, 243}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 344}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_queue, __pyx_mstate->__pyx_n_u_solutions, __pyx_mstate->__pyx_n_u_sorted_variables, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables}; - __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionsList, __pyx_k_N_O_E_E_F_A_Q_A_4_2_9A_A_9G1_WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionsList, __pyx_mstate->__pyx_kp_b_iso88591_N_O_E_E_F_A_Q_A_4_2_9A_A_9G1_WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 401, 53}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 401}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints}; - __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_k_77RRS_4q_4q_AYm1_t_AYa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_mstate->__pyx_kp_b_iso88591_77RRS_4q_4q_AYm1_t_AYa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 406, 48}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 406}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_iter}; - __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_66QQR_t_1I_4q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_mstate->__pyx_kp_b_iso88591_66QQR_t_1I_4q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 413, 78}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 413}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_lst, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u__5, __pyx_mstate->__pyx_n_u_c}; - __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSortedVariables, __pyx_k_iq_b_A_c_jPTT_a_5_Q_q_c_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSortedVariables, __pyx_mstate->__pyx_kp_b_iso88591_iq_b_A_c_jPTT_a_5_Q_q_c_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 456, 15}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 456}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_forwardcheck}; - __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 466, 296}; + const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 466}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_solutions, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_single, __pyx_mstate->__pyx_n_u_lst, __pyx_mstate->__pyx_n_u_item, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_pushdomains, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_x}; - __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_recursiveBacktracking, __pyx_k_A_b_A_c_jPTT_a_5_Q_HA_t2S_q_WA_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_recursiveBacktracking, __pyx_mstate->__pyx_kp_b_iso88591_A_b_A_c_jPTT_a_5_Q_HA_t2S_q_WA_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 519, 49}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 519}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_solutions}; - __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_66QQR_D_at9N_a_z_Yas_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_mstate->__pyx_kp_b_iso88591_66QQR_D_at9N_a_z_Yas_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 523, 32}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 523}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints}; - __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_k_77RRS_t_i_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_mstate->__pyx_kp_b_iso88591_77RRS_t_i_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 554, 23}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 554}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_steps, __pyx_mstate->__pyx_n_u_rand}; - __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_1_Ja_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_1_Ja_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 566, 319}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 566}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_choice, __pyx_mstate->__pyx_n_u_shuffle, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u__5, __pyx_mstate->__pyx_n_u_conflicted, __pyx_mstate->__pyx_n_u_lst, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_mincount, __pyx_mstate->__pyx_n_u_minvalues, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_count}; - __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_66QQR_V_d_fL_G7_F_a_L_q_F_7_1_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_mstate->__pyx_kp_b_iso88591_66QQR_V_d_fL_G7_F_a_L_q_F_7_1_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 644, 30}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 644}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_process_mode}; - __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_Ry_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_q_Ry_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 650, 37}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 650}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_msg}; - __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_66QQR_b_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_mstate->__pyx_kp_b_iso88591_66QQR_b_Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 662, 167}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 662}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_constraint_lookup, __pyx_mstate->__pyx_n_u_sorted_vars, __pyx_mstate->__pyx_n_u_first_var, __pyx_mstate->__pyx_n_u_remaining_vars, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_solutions, __pyx_mstate->__pyx_n_u_parallel_pool, __pyx_mstate->__pyx_n_u_executor, __pyx_mstate->__pyx_n_u_results, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionsList, __pyx_k_N_O_E_E_F_P_qPUUaaeeffkkoosszz, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionsList, __pyx_mstate->__pyx_kp_b_iso88591_N_O_E_E_F_P_qPUUaaeeffkkoosszz, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 688, 26}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 688}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints}; - __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_k_77RRS_t_AYa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_mstate->__pyx_kp_b_iso88591_77RRS_t_AYa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 693, 29}; + const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 693}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_assignment, __pyx_mstate->__pyx_n_u_constraints_lookup, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; - __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_is_valid, __pyx_k_BBn_o_J_J_K, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_is_valid, __pyx_mstate->__pyx_kp_b_iso88591_BBn_o_J_J_K, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 701, 57}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 701}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_func_string, __pyx_mstate->__pyx_n_u_code_object, __pyx_mstate->__pyx_n_u_func_3}; - __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_compile_to_function, __pyx_k_EQ_A_1_q_Qd_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_compile_to_function, __pyx_mstate->__pyx_kp_b_iso88591_EQ_A_1_q_Qd_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 708, 146}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 708}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_assignment, __pyx_mstate->__pyx_n_u_unassigned_vars, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraint_lookup, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_remaining_vars, __pyx_mstate->__pyx_n_u_solutions, __pyx_mstate->__pyx_n_u_value}; - __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_sequential_recursive_backtrack, __pyx_k_UUn_o_Z_Z_P_P_Q_t1_q_q_1__Cq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_sequential_recursive_backtrack, __pyx_mstate->__pyx_kp_b_iso88591_UUn_o_Z_Z_P_P_Q_t1_q_q_1__Cq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 724, 245}; + const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 724}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_assignment, __pyx_mstate->__pyx_n_u_unassigned_vars, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraint_lookup, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_sorted_variables, __pyx_mstate->__pyx_n_u_queue, __pyx_mstate->__pyx_n_u_solutions, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables}; - __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_sequential_optimized_backtrack, __pyx_k_UUn_o_Z_Z_P_P_Q_q_L_y_q_WA_Q_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_sequential_optimized_backtrack, __pyx_mstate->__pyx_kp_b_iso88591_UUn_o_Z_Z_P_P_Q_q_L_y_q_WA_Q_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 774, 186}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 774}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_process_mode, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraint_lookup, __pyx_mstate->__pyx_n_u_first_var, __pyx_mstate->__pyx_n_u_first_value, __pyx_mstate->__pyx_n_u_remaining_vars, __pyx_mstate->__pyx_n_u_local_assignment, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_vals}; - __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_parallel_worker, __pyx_k_U_U_V_k_FWWX_1_q_E_1_q_QgQe1A_P, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_parallel_worker, __pyx_mstate->__pyx_kp_b_iso88591_U_U_V_k_FWWX_1_q_E_1_q_QgQe1A_P, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; @@ -22223,22 +22148,37 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitGlobals(void) { /* PythonCompatibility.init */ if (likely(__Pyx_init_co_variables() == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + /* CommonTypesMetaclass.init */ + if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) /* CachedMethodType.init */ #if CYTHON_COMPILING_IN_LIMITED_API -{ - PyObject *typesModule=NULL; - typesModule = PyImport_ImportModule("types"); - if (typesModule) { - __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - } -} // error handling follows -#endif + { + PyObject *typesModule=NULL; + typesModule = PyImport_ImportModule("types"); + if (typesModule) { + __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + } + } // error handling follows + #endif + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + /* CythonFunctionShared.init */ + if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + /* Generator.init */ + if (likely(__pyx_Generator_init(__pyx_m) == 0)); else + + if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -22279,7 +22219,7 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { } #endif -/* PyErrExceptionMatches */ +/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; @@ -22320,7 +22260,7 @@ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tsta } #endif -/* PyErrFetchRestore */ +/* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 @@ -22379,7 +22319,7 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject } #endif -/* PyObjectGetAttrStr */ +/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); @@ -22389,7 +22329,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject } #endif -/* PyObjectGetAttrStrNoError */ +/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare @@ -22428,7 +22368,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { return result; } -/* TupleAndListFromArray */ +/* TupleAndListFromArray (used by fastcall) */ #if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) @@ -22441,11 +22381,11 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; for (i = 0; i < n; i++) { - if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { + Py_INCREF(src[i]); + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) { Py_DECREF(res); return NULL; } - Py_INCREF(src[i]); } return res; } @@ -22484,7 +22424,7 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) } #endif -/* BytesEquals */ +/* BytesEquals (used by UnicodeEquals) */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) @@ -22532,7 +22472,7 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq #endif } -/* UnicodeEquals */ +/* UnicodeEquals (used by fastcall) */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); @@ -22667,120 +22607,7 @@ CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, Py #endif #endif -/* RaiseDoubleKeywords */ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); -} - -/* PyFunctionFastCall */ -#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, - PyObject *globals) { - PyFrameObject *f; - PyThreadState *tstate = __Pyx_PyThreadState_Current; - PyObject **fastlocals; - Py_ssize_t i; - PyObject *result; - assert(globals != NULL); - /* XXX Perhaps we should create a specialized - PyFrame_New() that doesn't take locals, but does - take builtins without sanity checking them. - */ - assert(tstate != NULL); - f = PyFrame_New(tstate, co, globals, NULL); - if (f == NULL) { - return NULL; - } - fastlocals = __Pyx_PyFrame_GetLocalsplus(f); - for (i = 0; i < na; i++) { - Py_INCREF(*args); - fastlocals[i] = *args++; - } - result = PyEval_EvalFrameEx(f,0); - ++tstate->recursion_depth; - Py_DECREF(f); - --tstate->recursion_depth; - return result; -} -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) { - PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); - PyObject *globals = PyFunction_GET_GLOBALS(func); - PyObject *argdefs = PyFunction_GET_DEFAULTS(func); - PyObject *closure; - PyObject *kwdefs; - PyObject *kwtuple, **k; - PyObject **d; - Py_ssize_t nd; - Py_ssize_t nk; - PyObject *result; - assert(kwargs == NULL || PyDict_Check(kwargs)); - nk = kwargs ? PyDict_Size(kwargs) : 0; - if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { - return NULL; - } - if ( - co->co_kwonlyargcount == 0 && - likely(kwargs == NULL || nk == 0) && - co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { - if (argdefs == NULL && co->co_argcount == nargs) { - result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); - goto done; - } - else if (nargs == 0 && argdefs != NULL - && co->co_argcount == Py_SIZE(argdefs)) { - /* function called with no arguments, but all parameters have - a default value: use default values as arguments .*/ - args = &PyTuple_GET_ITEM(argdefs, 0); - result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); - goto done; - } - } - if (kwargs != NULL) { - Py_ssize_t pos, i; - kwtuple = PyTuple_New(2 * nk); - if (kwtuple == NULL) { - result = NULL; - goto done; - } - k = &PyTuple_GET_ITEM(kwtuple, 0); - pos = i = 0; - while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { - Py_INCREF(k[i]); - Py_INCREF(k[i+1]); - i += 2; - } - nk = i / 2; - } - else { - kwtuple = NULL; - k = NULL; - } - closure = PyFunction_GET_CLOSURE(func); - kwdefs = PyFunction_GET_KW_DEFAULTS(func); - if (argdefs != NULL) { - d = &PyTuple_GET_ITEM(argdefs, 0); - nd = Py_SIZE(argdefs); - } - else { - d = NULL; - nd = 0; - } - result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, kwdefs, closure); - Py_XDECREF(kwtuple); -done: - Py_LeaveRecursiveCall(); - return result; -} -#endif - -/* PyObjectCall */ +/* PyObjectCall (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; @@ -22800,7 +22627,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg } #endif -/* PyObjectCallMethO */ +/* PyObjectCallMethO (used by PyObjectFastCall) */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; @@ -22820,7 +22647,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject } #endif -/* PyObjectFastCall */ +/* PyObjectFastCall (used by PyObjectCallOneArg) */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; @@ -22844,7 +22671,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * con #elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { PyTypeObject *tp = Py_TYPE(callable); - #if defined(__Pyx_CyFunction_USED) + #if defined(__Pyx_CyFunction_USED) && CYTHON_METH_FASTCALL if (__Pyx_CyFunction_CheckExact(callable)) { return __Pyx_CyFunction_func_vectorcall(callable); } @@ -22875,38 +22702,16 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return __Pyx_PyObject_CallMethO(func, args[0]); } #endif - #if PY_VERSION_HEX < 0x030800B1 - #if CYTHON_FAST_PYCCALL - if (PyCFunction_Check(func)) { - if (kwargs) { - return _PyCFunction_FastCallDict(func, args, nargs, kwargs); - } else { - return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); - } - } - if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { - return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); - } - #endif - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(func)) { - return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); - } - #endif - #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API - vectorcallfunc f = __Pyx_PyVectorcall_Function(func); - if (f) { - return f(func, args, _nargs, NULL); - } - #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL - if (__Pyx_CyFunction_CheckExact(func)) { - __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, _nargs, NULL); - } - #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL - return PyObject_Vectorcall(func, args, _nargs, NULL); + #if CYTHON_VECTORCALL + #if CYTHON_COMPILING_IN_LIMITED_API + return PyObject_Vectorcall(func, args, _nargs, NULL); + #else + vectorcallfunc f = __Pyx_PyVectorcall_Function(func); + if (f) { + return f(func, args, _nargs, NULL); + } + #endif #endif } if (nargs == 0) { @@ -22919,7 +22724,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } -/* UnpackUnboundCMethod */ +/* PyObjectCallOneArg (used by CallUnboundCMethod0) */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *result; @@ -23004,6 +22815,121 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { return 0; } +/* CallUnboundCMethod0 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + if (likely(cfunc->flag == METH_NOARGS)) + return __Pyx_CallCFunction(cfunc, self, NULL); + if (likely(cfunc->flag == METH_FASTCALL)) + return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0); + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL); + if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS))) + return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL); + if (cfunc->flag == METH_VARARGS) + return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple); + return __Pyx__CallUnboundCMethod0(cfunc, self); + } +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + else if (unlikely(was_initialized == 1)) { + __Pyx_CachedCFunction tmp_cfunc = { +#ifndef __cplusplus + 0 +#endif + }; + tmp_cfunc.type = cfunc->type; + tmp_cfunc.method_name = cfunc->method_name; + return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self); + } +#endif + PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} +#endif +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *result; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; + result = __Pyx_PyObject_CallOneArg(cfunc->method, self); + return result; +} + +/* py_dict_items (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d); +} + +/* py_dict_values (used by OwnedDictNext) */ +static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d); +} + +/* OwnedDictNext (used by ParseKeywordsImpl) */ +#if CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) { + PyObject *next = NULL; + if (!*ppos) { + if (pvalue) { + PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p); + if (unlikely(!dictview)) goto bad; + *ppos = PyObject_GetIter(dictview); + Py_DECREF(dictview); + } else { + *ppos = PyObject_GetIter(p); + } + if (unlikely(!*ppos)) goto bad; + } + next = PyIter_Next(*ppos); + if (!next) { + if (PyErr_Occurred()) goto bad; + return 0; + } + if (pkey && pvalue) { + *pkey = __Pyx_PySequence_ITEM(next, 0); + if (unlikely(*pkey)) goto bad; + *pvalue = __Pyx_PySequence_ITEM(next, 1); + if (unlikely(*pvalue)) goto bad; + Py_DECREF(next); + } else if (pkey) { + *pkey = next; + } else { + assert(pvalue); + *pvalue = next; + } + return 1; + bad: + Py_XDECREF(next); +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 + PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef"); +#else + PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef); +#endif + if (pkey) *pkey = NULL; + if (pvalue) *pvalue = NULL; + return 0; +} +#else // !CYTHON_AVOID_BORROWED_REFS +static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) { + int result = PyDict_Next(p, ppos, pkey, pvalue); + if (likely(result == 1)) { + if (pkey) Py_INCREF(*pkey); + if (pvalue) Py_INCREF(*pvalue); + } + return result; +} +#endif + +/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); +} + /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { @@ -23058,7 +22984,7 @@ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObje } } -/* ParseKeywords */ +/* ParseKeywordsImpl (used by ParseKeywords) */ static int __Pyx_ValidateDuplicatePosArgs( PyObject *kwds, PyObject ** const argnames[], @@ -23214,16 +23140,23 @@ static void __Pyx_RejectUnknownKeyword( PyObject ** const *first_kw_arg, const char *function_name) { + #if CYTHON_AVOID_BORROWED_REFS + PyObject *pos = NULL; + #else Py_ssize_t pos = 0; + #endif PyObject *key = NULL; __Pyx_BEGIN_CRITICAL_SECTION(kwds); - while (PyDict_Next(kwds, &pos, &key, NULL)) { + while ( + #if CYTHON_AVOID_BORROWED_REFS + __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL) + #else + PyDict_Next(kwds, &pos, &key, NULL) + #endif + ) { PyObject** const *name = first_kw_arg; while (*name && (**name != key)) name++; if (!*name) { - #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); - #endif size_t index_found = 0; int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); if (cmp != 1) { @@ -23237,12 +23170,15 @@ static void __Pyx_RejectUnknownKeyword( #endif break; } - #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(key); - #endif } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif } __Pyx_END_CRITICAL_SECTION(); + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(pos); + #endif assert(PyErr_Occurred()); } static int __Pyx_ParseKeywordDict( @@ -23414,6 +23350,8 @@ static int __Pyx_ParseKeywordsTuple( #endif return -1; } + +/* ParseKeywords */ static int __Pyx_ParseKeywords( PyObject *kwds, PyObject * const *kwvalues, @@ -23459,7 +23397,7 @@ static void __Pyx_RaiseArgtupleInvalid( (num_expected == 1) ? "" : "s", num_found); } -/* ArgTypeTest */ +/* ArgTypeTestFunc (used by ArgTypeTest) */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; @@ -23545,19 +23483,14 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { return __Pyx_IterFinish(); } -/* PyObjectCall2Args */ +/* PyObjectCall2Args (used by PyObjectCallMethod1) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - -/* PyObjectGetMethod */ +/* PyObjectGetMethod (used by PyObjectCallMethod1) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP @@ -23646,9 +23579,10 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me *method = attr; return 0; } +#endif -/* PyObjectCallMethod1 */ -#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000) +/* PyObjectCallMethod1 (used by append) */ +#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); @@ -23656,9 +23590,8 @@ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { } #endif static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { -#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 +#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) PyObject *args[2] = {obj, arg}; - (void) __Pyx_PyObject_GetMethod; (void) __Pyx_PyObject_CallOneArg; (void) __Pyx_PyObject_Call2Args; return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); @@ -23689,14 +23622,15 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { } /* dict_setdefault */ -static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, - int is_safe_type) { +static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) { PyObject* value; - CYTHON_MAYBE_UNUSED_VAR(is_safe_type); -#if CYTHON_COMPILING_IN_LIMITED_API - value = PyObject_CallMethod(d, "setdefault", "OO", key, default_value); -#elif PY_VERSION_HEX >= 0x030d0000 +#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4) PyDict_SetDefaultRef(d, key, default_value, &value); +#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + PyObject *args[] = {d, key, default_value}; + value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#elif CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL); #else value = PyDict_SetDefault(d, key, default_value); if (unlikely(!value)) return NULL; @@ -23745,70 +23679,110 @@ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { Py_DECREF(j); return r; } +static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) { + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); +} static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + int wraparound, int boundscheck, int unsafe_shared) { + CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); +#if CYTHON_AVOID_BORROWED_REFS + CYTHON_UNUSED_VAR(boundscheck); + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + Py_ssize_t size = __Pyx_PyList_GET_SIZE(o); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) return NULL; + #endif + wrapped_i += size; + } + return __Pyx_PyList_GetItemRef(o, wrapped_i); +#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS Py_ssize_t wrapped_i = i; + Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1; if (wraparound & unlikely(i < 0)) { - wrapped_i += PyList_GET_SIZE(o); + wrapped_i += size; } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) { + return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared); } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic_size(o, i); #else + (void)wraparound; + (void)boundscheck; return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS + int wraparound, int boundscheck, int unsafe_shared) { + CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); +#if CYTHON_AVOID_BORROWED_REFS + CYTHON_UNUSED_VAR(boundscheck); + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) return NULL; + #endif + wrapped_i += size; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API + return PySequence_ITEM(o, wrapped_i); + #else + if (unlikely(wrapped_i < 0)) { + PyErr_SetString(PyExc_IndexError, "tuple index out of range"); + return NULL; + } + return PySequence_GetItem(o, wrapped_i); + #endif +#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS Py_ssize_t wrapped_i = i; + Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1; if (wraparound & unlikely(i < 0)) { - wrapped_i += PyTuple_GET_SIZE(o); + wrapped_i += size; } - if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); - Py_INCREF(r); - return r; + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) { + return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i)); } - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic_size(o, i); #else + (void)wraparound; + (void)boundscheck; return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, - CYTHON_NCP_UNUSED int wraparound, - CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + int wraparound, int boundscheck, int unsafe_shared) { + CYTHON_MAYBE_UNUSED_VAR(unsafe_shared); +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - return __Pyx_PyList_GetItemRef(o, n); - } - } - else if (PyTuple_CheckExact(o)) { + return boundscheck ? __Pyx_PyList_GetItemRef(o, n) : __Pyx_PyList_GET_ITEM_REF(o, n, unsafe_shared); + } else + #if !CYTHON_AVOID_BORROWED_REFS + if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; + return __Pyx_NewRef(PyTuple_GET_ITEM(o, n)); } - } else { + } else + #endif +#else + if ((!wraparound || i >= 0) & PyList_CheckExact(o)) { + return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared); + } else +#endif +#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY + { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; - if (mm && mm->mp_subscript) { + if (!is_list && mm && mm->mp_subscript) { PyObject *r, *key = PyLong_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } - if (likely(sm && sm->sq_item)) { + if (is_list || likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { @@ -23827,7 +23801,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return PySequence_GetItem(o, i); } #endif - return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); + (void)wraparound; + (void)boundscheck; + return __Pyx_GetItemInt_Generic_size(o, i); } /* ObjectGetItem */ @@ -23837,7 +23813,7 @@ static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { Py_ssize_t key_value; key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { - return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(index)); @@ -23851,6 +23827,11 @@ static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { + #if __PYX_LIMITED_VERSION_HEX >= 0x03090000 + if ((PyTypeObject*)obj == &PyType_Type) { + return Py_GenericAlias(obj, key); + } + #endif PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem); if (!meth) { PyErr_Clear(); @@ -23945,17 +23926,21 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, /* UnicodeConcatInPlace */ # if CYTHON_COMPILING_IN_CPYTHON static int -__Pyx_unicode_modifiable(PyObject *unicode) +__Pyx_unicode_modifiable(PyObject *unicode, int unsafe_shared) { - if (Py_REFCNT(unicode) != 1) + if (!__Pyx_IS_UNIQUELY_REFERENCED(unicode, unsafe_shared)) + return 0; +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030F0000 + if (PyUnstable_Unicode_GET_CACHED_HASH(unicode) != -1) return 0; +#endif if (!PyUnicode_CheckExact(unicode)) return 0; if (PyUnicode_CHECK_INTERNED(unicode)) return 0; return 1; } -static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right, int unsafe_shared #if CYTHON_REFNANNY , void* __pyx_refnanny #endif @@ -23982,7 +23967,8 @@ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_le return NULL; } new_len = left_len + right_len; - if (__Pyx_unicode_modifiable(left) + if (left != right + && __Pyx_unicode_modifiable(left, unsafe_shared) && PyUnicode_CheckExact(right) && PyUnicode_KIND(right) <= PyUnicode_KIND(left) && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) { @@ -24124,14 +24110,20 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr } #endif -/* PyObjectCallNoArg */ +/* PyObjectCallNoArg (used by PyObjectCallMethod0) */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } -/* PyObjectCallMethod0 */ +/* PyObjectCallMethod0 (used by dict_iter) */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { +#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)) + PyObject *args[1] = {obj}; + (void) __Pyx_PyObject_CallOneArg; + (void) __Pyx_PyObject_CallNoArg; + return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL); +#else PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { @@ -24144,14 +24136,15 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name Py_DECREF(method); bad: return result; +#endif } -/* RaiseNoneIterError */ +/* RaiseNoneIterError (used by UnpackTupleError) */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } -/* UnpackTupleError */ +/* UnpackTupleError (used by UnpackTuple2) */ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); @@ -24168,7 +24161,7 @@ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { } } -/* UnpackTuple2 */ +/* UnpackTuple2 (used by dict_iter) */ static CYTHON_INLINE int __Pyx_unpack_tuple2( PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) { if (likely(is_tuple || PyTuple_Check(tuple))) { @@ -24240,7 +24233,7 @@ static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyOb } /* dict_iter */ -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_AVOID_BORROWED_REFS #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, @@ -24248,7 +24241,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di is_dict = is_dict || likely(PyDict_CheckExact(iterable)); *p_source_is_dict = is_dict; if (is_dict) { -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; @@ -24277,7 +24270,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di iterable = __Pyx_PyObject_CallMethod0(iterable, method_name); if (!iterable) return NULL; -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable)) return iterable; #endif @@ -24287,7 +24280,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di } return PyObject_GetIter(iterable); } -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem) { @@ -24338,7 +24331,7 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) { PyObject* next_item; -#if !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_AVOID_BORROWED_REFS if (source_is_dict) { int result; #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API @@ -24372,17 +24365,8 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( #endif if (unlikely(pos >= list_size)) return 0; *ppos = pos + 1; - #if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS - next_item = PyList_GetItemRef(iter_obj, pos); + next_item = __Pyx_PyList_GET_ITEM_REF(iter_obj, pos, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!next_item)) return -1; - #elif CYTHON_ASSUME_SAFE_MACROS - next_item = PyList_GET_ITEM(iter_obj, pos); - Py_INCREF(next_item); - #else - next_item = PyList_GetItem(iter_obj, pos); - if (unlikely(!next_item)) return -1; - Py_INCREF(next_item); - #endif } else #endif { @@ -24404,7 +24388,7 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( return 1; } -/* LimitedApiGetTypeDict */ +/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */ #if CYTHON_COMPILING_IN_LIMITED_API static Py_ssize_t __Pyx_GetTypeDictOffset(void) { PyObject *tp_dictoffset_o; @@ -24440,7 +24424,7 @@ static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) { } #endif -/* SetItemOnTypeDict */ +/* SetItemOnTypeDict (used by FixUpExtensionType) */ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) { int result; PyObject *tp_dict; @@ -24462,7 +24446,7 @@ static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) return result; } -/* FixUpExtensionType */ +/* FixUpExtensionType (used by FetchCommonType) */ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if __PYX_LIMITED_VERSION_HEX > 0x030900B1 CYTHON_UNUSED_VAR(spec); @@ -24497,14 +24481,11 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); -#if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; -#else - type->tp_print = (printfunc) memb->offset; -#endif changed = 1; } #endif // CYTHON_METH_FASTCALL +#if !CYTHON_COMPILING_IN_PYPY else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); @@ -24519,11 +24500,13 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject } changed = 1; } +#endif // !CYTHON_COMPILING_IN_PYPY } memb++; } } #endif // !CYTHON_COMPILING_IN_LIMITED_API +#if !CYTHON_COMPILING_IN_PYPY slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_getset) slot++; @@ -24555,18 +24538,66 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject ++getset; } } +#else + CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict); +#endif // !CYTHON_COMPILING_IN_PYPY if (changed) PyType_Modified(type); #endif // PY_VERSION_HEX > 0x030900B1 return 0; } -/* FetchSharedCythonModule */ +/* AddModuleRef (used by FetchSharedCythonModule) */ +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) { + PyObject *module_dict = PyImport_GetModuleDict(); + PyObject *m; + if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) { + return NULL; + } + if (m != NULL && PyModule_Check(m)) { + return m; + } + Py_XDECREF(m); + m = PyModule_NewObject(name); + if (m == NULL) + return NULL; + if (PyDict_CheckExact(module_dict)) { + PyObject *new_m; + (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m); + Py_DECREF(m); + return new_m; + } else { + if (PyObject_SetItem(module_dict, name, m) != 0) { + Py_DECREF(m); + return NULL; + } + return m; + } + } + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *py_name = PyUnicode_FromString(name); + if (!py_name) return NULL; + PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name); + Py_DECREF(py_name); + return module; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif + +/* FetchSharedCythonModule (used by FetchCommonType) */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); } -/* FetchCommonType */ +/* FetchCommonType (used by CommonTypesMetaclass) */ #if __PYX_LIMITED_VERSION_HEX < 0x030C0000 static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases); @@ -24639,11 +24670,13 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyOb } else if (unlikely(get_item_ref_result == -1)) { goto bad; } - CYTHON_UNUSED_VAR(module); - cached_type = __Pyx_PyType_FromMetaclass(metaclass, abi_module, spec, bases); + cached_type = __Pyx_PyType_FromMetaclass( + metaclass, + CYTHON_USE_MODULE_STATE ? module : abi_module, + spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; - new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1); + new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type); if (unlikely(new_cached_type != cached_type)) { if (unlikely(!new_cached_type)) goto bad; Py_DECREF(cached_type); @@ -24669,26 +24702,39 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyOb goto done; } -/* CommonTypesMetaclass */ -PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { +/* CommonTypesMetaclass (used by CythonFunctionShared) */ +static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) { return PyUnicode_FromString(__PYX_ABI_MODULE_NAME); } +#if __PYX_LIMITED_VERSION_HEX < 0x030A0000 +static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) { + PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types"); + return NULL; +} +static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) { + PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable"); + return -1; +} +#endif static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = { {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL}, {0, 0, 0, 0, 0} }; static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = { {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset}, + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call}, + {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call}, + {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr}, + #endif {0, 0} }; static PyType_Spec __pyx_CommonTypesMetaclass_spec = { __PYX_TYPE_MODULE_PREFIX "_common_types_metatype", 0, 0, -#if PY_VERSION_HEX >= 0x030A0000 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | -#endif Py_TPFLAGS_DEFAULT, __pyx_CommonTypesMetaclass_slots }; @@ -24699,13 +24745,14 @@ static int __pyx_CommonTypesMetaclass_init(PyObject *module) { return -1; } mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases); + Py_DECREF(bases); if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) { return -1; } return 0; } -/* CallTypeTraverse */ +/* CallTypeTraverse (used by CythonFunctionShared) */ #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) #else static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) { @@ -24724,7 +24771,7 @@ static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visi } #endif -/* PyMethodNew */ +/* PyMethodNew (used by CythonFunctionShared) */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *result; @@ -24750,15 +24797,20 @@ static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *ty } #endif -/* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +/* PyVectorcallFastCallDict (used by CythonFunctionShared) */ +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; - Py_ssize_t i, pos; + Py_ssize_t i; + #if CYTHON_AVOID_BORROWED_REFS + PyObject *pos; + #else + Py_ssize_t pos; + #endif size_t j; PyObject *key, *value; unsigned long keys_are_strings; @@ -24780,17 +24832,16 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector return NULL; } kwvalues = newargs + nargs; - pos = i = 0; + pos = 0; + i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; - while (PyDict_Next(kw, &pos, &key, &value)) { + while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) { keys_are_strings &= #if CYTHON_COMPILING_IN_LIMITED_API PyType_GetFlags(Py_TYPE(key)); #else Py_TYPE(key)->tp_flags; #endif - Py_INCREF(key); - Py_INCREF(value); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; #else @@ -24805,6 +24856,9 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } res = vc(func, newargs, nargs, kwnames); cleanup: + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(pos); + #endif Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); @@ -24833,7 +24887,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, _ } #endif -/* CythonFunctionShared */ +/* CythonFunctionShared (used by CythonFunction) */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) { if (__Pyx_CyFunction_Check(func)) { @@ -24985,9 +25039,11 @@ __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void __Pyx_END_CRITICAL_SECTION(); return 0; } +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject * -__Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) @@ -24996,36 +25052,7 @@ __Pyx_CyFunction_get_dict_locked(__pyx_CyFunctionObject *op) Py_INCREF(op->func_dict); return op->func_dict; } -static PyObject * -__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) -{ - CYTHON_UNUSED_VAR(context); - PyObject *result; - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_dict_locked(op); - __Pyx_END_CRITICAL_SECTION(); - return result; -} -static int -__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) -{ - CYTHON_UNUSED_VAR(context); - if (unlikely(value == NULL)) { - PyErr_SetString(PyExc_TypeError, - "function's dictionary may not be deleted"); - return -1; - } - if (unlikely(!PyDict_Check(value))) { - PyErr_SetString(PyExc_TypeError, - "setting function's dictionary to a non-dict"); - return -1; - } - Py_INCREF(value); - __Pyx_BEGIN_CRITICAL_SECTION(op); - __Pyx_Py_XDECREF_SET(op->func_dict, value); - __Pyx_END_CRITICAL_SECTION(); - return 0; -} +#endif static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { @@ -25153,6 +25180,7 @@ __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { __Pyx_END_CRITICAL_SECTION(); return result; } +static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value); static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); @@ -25167,8 +25195,54 @@ __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, vo __Pyx_BEGIN_CRITICAL_SECTION(op); __Pyx_Py_XDECREF_SET(op->func_annotations, value); __Pyx_END_CRITICAL_SECTION(); + if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists((PyObject*) op, Py_None) < 0)) return -1; return 0; } +static int +__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) { + /* Return 1 if the function dict exists, 0 otherwise. This cannot fail: + * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */ +#if CYTHON_COMPILING_IN_PYPY + *dict = PyObject_GenericGetDict(op_in, NULL); +#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000 + *dict = ((__pyx_CyFunctionObject*) op_in)->func_dict; +#else + PyObject **dictptr = _PyObject_GetDictPtr(op_in); + *dict = likely(dictptr) ? *dictptr : NULL; +#endif + return *dict ? 1 : 0; +} +static int +__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) { + PyObject *dict; + int dict_found; + *annotate = NULL; + dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict); + if (!dict_found) return 0; + return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate); +} +static int +__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) { + PyObject *dict; + int dict_found; + dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict); + if (!dict_found) return 0; + return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value); +} +static int +__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) { + PyObject *dict; + int result; +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + dict = __Pyx_CyFunction_get_dict((__pyx_CyFunctionObject*) op_in, NULL); +#else + dict = PyObject_GenericGetDict(op_in, NULL); +#endif + if (unlikely(!dict)) return -1; + result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value); + Py_DECREF(dict); + return result; +} static PyObject * __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; @@ -25181,14 +25255,88 @@ __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) { return result; } static PyObject * -__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { - PyObject *result; +__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) { + PyObject *annotate = NULL; + PyObject *result = NULL; + __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in; CYTHON_UNUSED_VAR(context); - __Pyx_BEGIN_CRITICAL_SECTION(op); - result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + result = __Pyx_XNewRef(op->func_annotations); + __Pyx_END_CRITICAL_SECTION(); + if (result) return result; + if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL; + if (!annotate || annotate == Py_None) { + Py_XDECREF(annotate); + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + result = __Pyx_CyFunction_get_annotations_locked(op); + __Pyx_END_CRITICAL_SECTION(); + return result; + } + PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE + if (likely(format)) { + result = __Pyx_PyObject_CallOneArg(annotate, format); + Py_DECREF(format); + } + Py_DECREF(annotate); + if (unlikely(!result)) return NULL; + if (unlikely(!PyDict_Check(result))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict"); + Py_DECREF(result); + return NULL; + } + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result)); __Pyx_END_CRITICAL_SECTION(); return result; } +static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *args) { + CYTHON_UNUSED_VAR(args); + if (unlikely(!self)) { + PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument"); + } + Py_XINCREF(self); + return self; +} +static PyMethodDef __Pyx_CyFunction_annotate_method = { + "__annotate__", + (PyCFunction)(void (*)(void))__Pyx_CyFunction_annotate_impl, + METH_VARARGS, + "Placeholder __annotate__ function to allow 'functools.wraps' to work " + "on Cython functions." +}; +static PyObject * +__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) { + PyObject *annotate = NULL; + CYTHON_UNUSED_VAR(context); + if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL; + if (annotate) return annotate; + PyObject *annotations = __Pyx_CyFunction_get_annotations(op_in, NULL); + if (unlikely(!annotations)) return NULL; + PyObject *method = PyCFunction_New( + &__Pyx_CyFunction_annotate_method, + annotations); + Py_DECREF(annotations); + return method; +} +static int +__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted"); + return -1; + } + if (unlikely(value != Py_None && !PyCallable_Check(value))) { + PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None"); + return -1; + } + if (value != Py_None) { + __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in; + __Pyx_BEGIN_CRITICAL_SECTION(op_in); + Py_CLEAR(op->func_annotations); + __Pyx_END_CRITICAL_SECTION(); + } + return __Pyx_CyFunction_set_annotate_in_dict(op_in, value); +} static PyObject * __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; @@ -25201,7 +25349,6 @@ __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) { PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { - Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } @@ -25287,8 +25434,13 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, + {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0}, +#else + {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, + {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0}, +#endif {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, @@ -25299,6 +25451,7 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0}, {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, @@ -25309,9 +25462,11 @@ static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#endif #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, @@ -25367,7 +25522,9 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_XINCREF(module); cf->m_module = module; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API op->func_dict = NULL; +#endif op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; @@ -25421,14 +25578,19 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func_dict); +#elif PY_VERSION_HEX < 0x030d0000 + _PyObject_ClearManagedDict((PyObject*)m); +#else + PyObject_ClearManagedDict((PyObject*)m); +#endif Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API -#if PY_VERSION_HEX < 0x030900B1 +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { @@ -25436,7 +25598,6 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } -#endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); @@ -25469,17 +25630,29 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func_dict); +#else + { + int e = +#if PY_VERSION_HEX < 0x030d0000 + _PyObject_VisitManagedDict +#else + PyObject_VisitManagedDict +#endif + ((PyObject*)m, visit, arg); + if (e != 0) return e; + } +#endif __Pyx_VISIT_CONST(m->func_name); __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); __Pyx_VISIT_CONST(m->func_code); -#if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); -#endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_annotations); Py_VISIT(m->func_is_coroutine); Py_VISIT(m->defaults); return 0; @@ -25581,7 +25754,7 @@ static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *a static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE @@ -25620,7 +25793,7 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) +#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; @@ -25642,11 +25815,7 @@ static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionO static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -25681,11 +25850,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -25720,11 +25885,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -25755,11 +25916,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); -#if CYTHON_BACKPORT_VECTORCALL - Py_ssize_t nargs = (Py_ssize_t)nargsf; -#else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); -#endif PyObject *self; #if CYTHON_COMPILING_IN_LIMITED_API PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); @@ -25784,7 +25941,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); + #if PY_VERSION_HEX < 0x030e00A6 + size_t nargs_value = (size_t) nargs; + #else + Py_ssize_t nargs_value = nargs; + #endif + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames); } #endif static PyType_Slot __pyx_CyFunctionType_slots[] = { @@ -25813,9 +25975,10 @@ static PyType_Spec __pyx_CyFunctionType_spec = { _Py_TPFLAGS_HAVE_VECTORCALL | #endif #endif // CYTHON_METH_FASTCALL -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | +#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_TPFLAGS_MANAGED_DICT | #endif + Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; @@ -25864,12 +26027,12 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual return op; } -/* PyObjectVectorCallKwBuilder */ +/* PyObjectVectorCallKwBuilder (used by PyObjectVectorCallMethodKwBuilder) */ #if CYTHON_VECTORCALL static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { (void)__Pyx_PyObject_FastCallDict; - if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; Py_INCREF(key); + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; args[n] = value; return 0; } @@ -25909,47 +26072,6 @@ static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, P } #endif -/* CallUnboundCMethod0 */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { - int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); - if (likely(was_initialized == 2 && cfunc->func)) { - if (likely(cfunc->flag == METH_NOARGS)) - return __Pyx_CallCFunction(cfunc, self, NULL); - if (likely(cfunc->flag == METH_FASTCALL)) - return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0); - if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) - return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL); - if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS))) - return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL); - if (cfunc->flag == METH_VARARGS) - return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple); - return __Pyx__CallUnboundCMethod0(cfunc, self); - } -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - else if (unlikely(was_initialized == 1)) { - __Pyx_CachedCFunction tmp_cfunc = { -#ifndef __cplusplus - 0 -#endif - }; - tmp_cfunc.type = cfunc->type; - tmp_cfunc.method_name = cfunc->method_name; - return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self); - } -#endif - PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self); - __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); - return result; -} -#endif -static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { - PyObject *result; - if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; - result = __Pyx_PyObject_CallOneArg(cfunc->method, self); - return result; -} - /* pop */ static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) { if (__Pyx_IS_TYPE(L, &PySet_Type)) { @@ -25967,7 +26089,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) { } #endif -/* GetException */ +/* GetException (used by pep479) */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else @@ -25988,12 +26110,12 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif -#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000 +#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000 local_value = PyErr_GetRaisedException(); #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif -#if __PYX_LIMITED_VERSION_HEX > 0x030C0000 +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); @@ -26011,7 +26133,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } -#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000 +#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000 Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); @@ -26058,7 +26180,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; -#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000 +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 bad: *type = 0; *value = 0; @@ -26098,9 +26220,10 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { } PyException_SetCause(new_exc, val); // steals ref to val PyErr_SetObject(PyExc_RuntimeError, new_exc); + Py_DECREF(new_exc); } -/* IterNextPlain */ +/* IterNextPlain (used by IterNext) */ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) { if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache)) @@ -26124,15 +26247,6 @@ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { } /* IterNext */ -#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03080000 -static PyObject *__Pyx_PyIter_Next2(PyObject *o, PyObject *defval) { - PyObject *result; - PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); - if (unlikely(!next)) return NULL; - result = PyObject_CallFunctionObjArgs(next, o, defval, NULL); - return result; -} -#else static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) { PyObject* exc_type; __Pyx_PyThreadState_declare @@ -26185,9 +26299,8 @@ static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* } return __Pyx_PyIter_Next2Default(defval); } -#endif -/* GetTopmostException */ +/* GetTopmostException (used by SaveResetException) */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) @@ -26269,7 +26382,7 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject } #endif -/* PyDictVersioning */ +/* PyDictVersioning (used by GetModuleGlobalName) */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; @@ -26346,98 +26459,68 @@ static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); const long b = intval; - long a, x; -#ifdef HAVE_LONG_LONG + long a; const PY_LONG_LONG llb = intval; - PY_LONG_LONG lla, llx; -#endif + PY_LONG_LONG lla; if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } - if (likely(__Pyx_PyLong_IsCompact(op1))) { - a = __Pyx_PyLong_CompactValue(op1); + const int is_positive = __Pyx_PyLong_IsPos(op1); + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1); + if (likely(size == 1)) { + a = (long) digits[0]; + if (!is_positive) a *= -1; } else { - const digit* digits = __Pyx_PyLong_Digits(op1); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { - lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - 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])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; + break; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { - 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])); - goto long_long; - #endif - } - CYTHON_FALLTHROUGH; - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG - } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { - 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])); - goto long_long; - #endif + 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])); + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; + break; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - #ifdef HAVE_LONG_LONG + if (!is_positive) a *= -1; + goto calculate_long; } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { 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])); - goto long_long; - #endif + if (!is_positive) lla *= -1; + goto calculate_long_long; } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_add(op1, op2); + break; } + return PyLong_Type.tp_as_number->nb_add(op1, op2); } + calculate_long: + { + long x; x = a + b; - return PyLong_FromLong(x); -#ifdef HAVE_LONG_LONG - long_long: + return PyLong_FromLong(x); + } + calculate_long_long: + { + PY_LONG_LONG llx; llx = lla + llb; - return PyLong_FromLongLong(llx); -#endif - return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace); - + return PyLong_FromLongLong(llx); + } } #endif @@ -26694,7 +26777,7 @@ static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyOb } #endif -/* GetAttr */ +/* GetAttr (used by Globals) */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS if (likely(PyUnicode_Check(n))) @@ -26708,7 +26791,29 @@ static PyObject* __Pyx_Globals(void) { return __Pyx_NewRef(__pyx_mstate_global->__pyx_d); } -/* ValidateBasesTuple */ +/* AllocateExtensionType */ +static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) { + if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc); + return alloc_func(t, 0); + } else { + newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc); + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (!tp_new) { + PyObject *new_str = PyUnicode_FromString("__new__"); + if (likely(new_str)) { + PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL); + Py_DECREF(new_str); + return o; + } else + return NULL; + } else + #endif + return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0); + } +} + +/* ValidateBasesTuple (used by PyType_Ready) */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; @@ -26878,19 +26983,121 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #endif } -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { +/* HasAttr (used by ImportImpl) */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 +static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { + PyObject *r; + if (unlikely(!PyUnicode_Check(n))) { + PyErr_SetString(PyExc_TypeError, + "hasattr(): attribute name must be string"); + return -1; + } + r = __Pyx_PyObject_GetAttrStrNoError(o, n); + if (!r) { + return (unlikely(PyErr_Occurred())) ? -1 : 0; + } else { + Py_DECREF(r); + return 1; + } +} +#endif + +/* ImportImpl (used by Import) */ +static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) { + PyObject *imported_module = PyImport_GetModule(qualname); + if (unlikely(!imported_module)) { + *module = NULL; + if (PyErr_Occurred()) { + return -1; + } + return 0; + } + *module = imported_module; + return 1; +} +static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) { + PyObject *imported_module; + PyObject *top_level_package_name; + Py_ssize_t i; + int status, module_found; + Py_ssize_t dot_index; + module_found = __Pyx__Import_GetModule(qualname, &imported_module); + if (unlikely(!module_found || module_found == -1)) { + *module = NULL; + return module_found; + } + if (imported_names) { + for (i = 0; i < len_imported_names; i++) { + PyObject *imported_name = imported_names[i]; +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 + int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name); +#else + int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name); + if (unlikely(has_imported_attribute == -1)) goto error; +#endif + if (!has_imported_attribute) { + goto not_found; + } + } + *module = imported_module; + return 1; + } + dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1); + if (dot_index == -1) { + *module = imported_module; + return 1; + } + if (unlikely(dot_index == -2)) goto error; + top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index); + if (unlikely(!top_level_package_name)) goto error; + Py_DECREF(imported_module); + status = __Pyx__Import_GetModule(top_level_package_name, module); + Py_DECREF(top_level_package_name); + return status; +error: + Py_DECREF(imported_module); + *module = NULL; + return -1; +not_found: + Py_DECREF(imported_module); + *module = NULL; + return 0; +} +static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) { PyObject *module = 0; PyObject *empty_dict = 0; - PyObject *empty_list = 0; + PyObject *from_list = 0; + int module_found; + if (!qualname) { + qualname = name; + } + module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module); + if (likely(module_found == 1)) { + return module; + } else if (unlikely(module_found == -1)) { + return NULL; + } empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; + if (imported_names) { +#if CYTHON_COMPILING_IN_CPYTHON + from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names); + if (unlikely(!from_list)) + goto bad; +#else + from_list = PyList_New(len_imported_names); + if (unlikely(!from_list)) goto bad; + for (Py_ssize_t i=0; i__pyx_d, empty_dict, from_list, 1); + name, moddict, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; @@ -26901,145 +27108,17 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { } if (!module) { module = PyImport_ImportModuleLevelObject( - name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); + name, moddict, empty_dict, from_list, level); } bad: + Py_XDECREF(from_list); Py_XDECREF(empty_dict); - Py_XDECREF(empty_list); - return module; -} - -/* ImportDottedModule */ -static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { - PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; - Py_ssize_t size; - if (unlikely(PyErr_Occurred())) { - PyErr_Clear(); - } -#if CYTHON_ASSUME_SAFE_SIZE - size = PyTuple_GET_SIZE(parts_tuple); -#else - size = PyTuple_Size(parts_tuple); - if (size < 0) goto bad; -#endif - if (likely(size == count)) { - partial_name = name; - } else { - slice = PySequence_GetSlice(parts_tuple, 0, count); - if (unlikely(!slice)) - goto bad; - sep = PyUnicode_FromStringAndSize(".", 1); - if (unlikely(!sep)) - goto bad; - partial_name = PyUnicode_Join(sep, slice); - } - PyErr_Format( - PyExc_ModuleNotFoundError, - "No module named '%U'", partial_name); -bad: - Py_XDECREF(sep); - Py_XDECREF(slice); - Py_XDECREF(partial_name); - return NULL; -} -static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { - PyObject *imported_module; -#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ - CYTHON_COMPILING_IN_GRAAL - PyObject *modules = PyImport_GetModuleDict(); - if (unlikely(!modules)) - return NULL; - imported_module = __Pyx_PyDict_GetItemStr(modules, name); - Py_XINCREF(imported_module); -#else - imported_module = PyImport_GetModule(name); -#endif - return imported_module; -} -static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { - Py_ssize_t i, nparts; -#if CYTHON_ASSUME_SAFE_SIZE - nparts = PyTuple_GET_SIZE(parts_tuple); -#else - nparts = PyTuple_Size(parts_tuple); - if (nparts < 0) return NULL; -#endif - for (i=1; i < nparts && module; i++) { - PyObject *part, *submodule; -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - part = PyTuple_GET_ITEM(parts_tuple, i); -#else - part = __Pyx_PySequence_ITEM(parts_tuple, i); - if (!part) return NULL; -#endif - submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) - Py_DECREF(part); -#endif - Py_DECREF(module); - module = submodule; - } - if (unlikely(!module)) { - return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); - } return module; } -static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { - PyObject *imported_module; - PyObject *module = __Pyx_Import(name, NULL, 0); - if (!parts_tuple || unlikely(!module)) - return module; - imported_module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(imported_module)) { - Py_DECREF(module); - return imported_module; - } - PyErr_Clear(); - return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -} -static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *module = __Pyx__ImportDottedModule_Lookup(name); - if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec); - if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_initializing); - if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { - Py_DECREF(spec); - spec = NULL; - } - Py_XDECREF(unsafe); - } - if (likely(!spec)) { - PyErr_Clear(); - return module; - } - Py_DECREF(spec); - Py_DECREF(module); - } else if (PyErr_Occurred()) { - PyErr_Clear(); - } -#endif - return __Pyx__ImportDottedModule(name, parts_tuple); -} -/* ListPack */ -static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { - va_list va; - PyObject *l = PyList_New(n); - va_start(va, n); - if (unlikely(!l)) goto end; - for (Py_ssize_t i=0; i__pyx_d, level); } /* ImportFrom */ @@ -27081,7 +27160,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { return value; } -/* CalculateMetaclass */ +/* CalculateMetaclass (used by Py3ClassCreate) */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_SIZE @@ -27305,55 +27384,44 @@ static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *class return 0; } -/* CLineInTraceback */ +/* CLineInTraceback (used by AddTraceback) */ #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o)) +#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL); +#else +PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) { + PyObject **dict_ptr = _PyObject_GetDictPtr(o); + return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL; +} +#endif static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { - PyObject *use_cline; + PyObject *use_cline = NULL; PyObject *ptype, *pvalue, *ptraceback; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject **cython_runtime_dict; -#endif + PyObject *cython_runtime_dict; CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); -#if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); + cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { - __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict); __PYX_PY_DICT_LOOKUP_IF_MODIFIED( - use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) - Py_XINCREF(use_cline); - __Pyx_END_CRITICAL_SECTION(); - } else -#endif - { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); - if (use_cline_obj) { - use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; - Py_INCREF(use_cline); - Py_DECREF(use_cline_obj); - } else { - PyErr_Clear(); - use_cline = NULL; - } - } - if (!use_cline) { - c_line = 0; - (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); + use_cline, cython_runtime_dict, + __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False)) } - else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } Py_XDECREF(use_cline); + Py_XDECREF(cython_runtime_dict); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif -/* CodeObjectCache */ +/* CodeObjectCache (used by AddTraceback) */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -27505,8 +27573,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { - (void) __pyx_cfilenm; - (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = __pyx_find_code_object(c_line ? -c_line : py_line); @@ -27515,7 +27582,11 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); + if (c_line) { + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + } else { + py_funcname = PyUnicode_FromString(funcname); + } if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; @@ -27623,7 +27694,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif @@ -27631,10 +27702,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { } else { if (sizeof(long) <= sizeof(long)) { return PyLong_FromLong((long) value); -#ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif } } { @@ -27717,7 +27786,7 @@ __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) } #endif -/* CIntFromPyVerify */ +/* CIntFromPyVerify (used by CIntFromPy) */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ @@ -27813,10 +27882,8 @@ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -27885,10 +27952,8 @@ static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif } } { @@ -28067,10 +28132,8 @@ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif } } else { #if CYTHON_USE_PYLONG_INTERNALS @@ -28139,10 +28202,8 @@ static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif } } { @@ -28334,7 +28395,40 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj } #endif -/* SwapException */ +/* GetRuntimeVersion */ +#if __PYX_LIMITED_VERSION_HEX < 0x030b0000 +void __Pyx_init_runtime_version(void) { + if (__Pyx_cached_runtime_version == 0) { + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + __Pyx_cached_runtime_version = version; + } +} +#endif +static unsigned long __Pyx_get_runtime_version(void) { +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 + return Py_Version & ~0xFFUL; +#else + return __Pyx_cached_runtime_version; +#endif +} + +/* SwapException (used by CoroutineBase) */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; @@ -28388,7 +28482,7 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, } #endif -/* ReturnWithStopIteration */ +/* ReturnWithStopIteration (used by CoroutineBase) */ static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) { if (value == Py_None) { @@ -28442,7 +28536,7 @@ static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { Py_DECREF(exc); } -/* CoroutineBase */ +/* CoroutineBase (used by Generator) */ #if !CYTHON_COMPILING_IN_LIMITED_API #include #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) @@ -29053,7 +29147,8 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject ret = __Pyx_PyObject_Call(meth, args, NULL); } else { PyObject *cargs[4] = {NULL, typ, val, tb}; - ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + size_t nargs = 1U + (val != NULL) + (tb != NULL); + ret = __Pyx_PyObject_FastCall(meth, cargs+1, nargs | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } Py_DECREF(meth); } @@ -29125,7 +29220,9 @@ static int __Pyx_Coroutine_clear(PyObject *self) { static void __Pyx_Coroutine_dealloc(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject_GC_UnTrack(gen); + #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API if (gen->gi_weakreflist != NULL) + #endif PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); @@ -29248,14 +29345,10 @@ __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void __Pyx_Py_XDECREF_SET(self->gi_qualname, value); return 0; } -static PyObject * -__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) -{ #if !CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx__Coroutine_get_frame_locked(__pyx_CoroutineObject *self) { PyObject *frame; - #if PY_VERSION_HEX >= 0x030d0000 - Py_BEGIN_CRITICAL_SECTION(self); - #endif frame = self->gi_frame; if (!frame) { if (unlikely(!self->gi_code)) { @@ -29280,9 +29373,17 @@ __Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) } } Py_INCREF(frame); - #if PY_VERSION_HEX >= 0x030d0000 - Py_END_CRITICAL_SECTION(); - #endif + return frame; +} +#endif +static PyObject * +__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self) +{ +#if !CYTHON_COMPILING_IN_LIMITED_API + PyObject *frame; + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)self); + frame = __Pyx__Coroutine_get_frame_locked(self); + __Pyx_END_CRITICAL_SECTION(); return frame; #else CYTHON_UNUSED_VAR(self); @@ -29326,7 +29427,9 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( #if CYTHON_USE_EXC_INFO_STACK gen->gi_exc_state.previous_item = NULL; #endif +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API gen->gi_weakreflist = NULL; +#endif Py_XINCREF(qualname); gen->gi_qualname = qualname; Py_XINCREF(name); @@ -29336,40 +29439,32 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( Py_XINCREF(code); gen->gi_code = code; gen->gi_frame = NULL; +#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) + memset(gen->__pyx_pymonitoring_state, 0, sizeof(gen->__pyx_pymonitoring_state)); + gen->__pyx_pymonitoring_version = 0; +#endif PyObject_GC_Track(gen); return gen; } static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) { char result; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen); result = gen->is_running; gen->is_running = 1; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif + __Pyx_END_CRITICAL_SECTION(); return result; } static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) { - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen); assert(gen->is_running); gen->is_running = 0; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif + __Pyx_END_CRITICAL_SECTION(); } static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) { char result; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_BEGIN_CRITICAL_SECTION(gen); - #endif + __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen); result = gen->is_running; - #if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API - Py_END_CRITICAL_SECTION(); - #endif + __Pyx_END_CRITICAL_SECTION(); return result; } static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) { @@ -29415,7 +29510,9 @@ static PyMemberDef __pyx_Generator_memberlist[] = { PyDoc_STR("object being iterated by 'yield from', or None")}, {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, +#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, +#endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { @@ -29449,10 +29546,11 @@ static PyType_Spec __pyx_GeneratorType_spec = { __PYX_TYPE_MODULE_PREFIX "generator", sizeof(__pyx_CoroutineObject), 0, -#if PY_VERSION_HEX >= 0x030A0000 - Py_TPFLAGS_IMMUTABLETYPE | +#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API + Py_TPFLAGS_MANAGED_WEAKREF | #endif - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, + Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION | + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND, __pyx_GeneratorType_slots }; #if __PYX_HAS_PY_AM_SEND == 2 @@ -29484,36 +29582,6 @@ static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { return retval; } -/* GetRuntimeVersion */ -static unsigned long __Pyx_get_runtime_version(void) { -#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 - return Py_Version & ~0xFFUL; -#else - static unsigned long __Pyx_cached_runtime_version = 0; - if (__Pyx_cached_runtime_version == 0) { - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); - ++i; - } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; - } - __Pyx_cached_runtime_version = version; - } - return __Pyx_cached_runtime_version; -#endif -} - /* CheckBinaryVersion */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; @@ -29597,9 +29665,13 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1 + if (likely(result)) + result->_co_firsttraceable = 0; + #endif return result; } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY +#elif !CYTHON_COMPILING_IN_PYPY #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else @@ -29611,10 +29683,10 @@ static PyObject* __Pyx_PyCode_New( PyObject * const *varnames, PyObject *filename, PyObject *funcname, - const char *line_table, + PyObject *line_table, PyObject *tuple_dedup_map ) { - PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL; + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL; Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; PyObject *varnames_tuple = PyTuple_New(var_count); if (unlikely(!varnames_tuple)) return NULL; @@ -29635,11 +29707,12 @@ static PyObject* __Pyx_PyCode_New( #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(varnames_tuple_dedup); #endif - if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL - && !CYTHON_COMPILING_IN_GRAAL) { - line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length); - if (unlikely(!line_table_bytes)) goto done; - Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3; + if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) { + Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(line_table_length == -1)) goto done; + #endif + Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL; code_bytes = PyBytes_FromStringAndSize(NULL, code_len); if (unlikely(!code_bytes)) goto done; char* c_code_bytes = PyBytes_AsString(code_bytes); @@ -29662,11 +29735,10 @@ static PyObject* __Pyx_PyCode_New( filename, funcname, (int) descr.first_line, - (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes ); done: Py_XDECREF(code_bytes); - Py_XDECREF(line_table_bytes); #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(varnames_tuple_dedup); #endif @@ -29674,30 +29746,68 @@ static PyObject* __Pyx_PyCode_New( return code_obj; } -/* InitStrings */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { - while (t->s) { - PyObject *str; - if (t->is_unicode) { - if (t->intern) { - str = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); - } else { - str = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - str = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - if (!str) - return -1; - *target = str; - if (PyObject_Hash(str) == -1) - return -1; - ++t; - ++target; +/* DecompressString */ +static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) { + PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed; + const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib"; + PyObject *methodname = PyUnicode_FromString("decompress"); + if (unlikely(!methodname)) return NULL; + #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000 + if (algo == 3) { + PyObject *fromlist = Py_BuildValue("[O]", methodname); + if (unlikely(!fromlist)) goto bad; + module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + } else + #endif + module = PyImport_ImportModule(module_name); + if (unlikely(!module)) goto import_failed; + decompress = PyObject_GetAttr(module, methodname); + if (unlikely(!decompress)) goto import_failed; + { + #ifdef __cplusplus + char *memview_bytes = const_cast(s); + #else + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wcast-qual" + #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcast-qual" + #endif + char *memview_bytes = (char*) s; + #if defined(__clang__) + #pragma clang diagnostic pop + #elif !defined(__INTEL_COMPILER) && defined(__GNUC__) + #pragma GCC diagnostic pop + #endif + #endif + #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ) + int memview_flags = 0x100; + #else + int memview_flags = PyBUF_READ; + #endif + compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags); } - return 0; + if (unlikely(!compressed_bytes)) { + Py_DECREF(decompress); + goto bad; + } + decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL); + Py_DECREF(compressed_bytes); + Py_DECREF(decompress); + Py_DECREF(module); + Py_DECREF(methodname); + return decompressed; +import_failed: + PyErr_Format(PyExc_ImportError, + "Failed to import '%.20s.decompress' - cannot initialise module strings. " + "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.", + module_name, algo); +bad: + Py_XDECREF(module); + Py_DECREF(methodname); + return NULL; } #include @@ -29919,7 +30029,7 @@ static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { return __Pyx_NewRef(Py_None); } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { - return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); + return __Pyx_NewRef(b ? Py_True: Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { return PyLong_FromSize_t(ival); diff --git a/docs/requirements.txt b/docs/requirements.txt index 4f61eb8..c1bb82a 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,33 +1,34 @@ -alabaster==0.7.16 ; python_version >= "3.9" -babel==2.17.0 ; python_version >= "3.9" -certifi==2025.1.31 ; python_version >= "3.9" -charset-normalizer==3.4.1 ; python_version >= "3.9" -colorama==0.4.6 ; python_version >= "3.9" and sys_platform == "win32" -docutils==0.21.2 ; python_version >= "3.9" -dom-toml==2.0.1 ; python_version >= "3.9" -domdf-python-tools==3.10.0 ; python_version >= "3.9" -idna==3.10 ; python_version >= "3.9" -imagesize==1.4.1 ; python_version >= "3.9" -importlib-metadata==8.6.1 ; python_version >= "3.9" and python_version < "3.10" -jinja2==3.1.6 ; python_version >= "3.9" -markupsafe==3.0.2 ; python_version >= "3.9" -natsort==8.4.0 ; python_version >= "3.9" -packaging==24.2 ; python_version >= "3.9" -pygments==2.19.1 ; python_version >= "3.9" -requests==2.32.4 ; python_version >= "3.9" -snowballstemmer==2.2.0 ; python_version >= "3.9" -sphinx-autodoc-typehints==2.3.0 ; python_version >= "3.9" -sphinx-pyproject==0.3.0 ; python_version >= "3.9" -sphinx-rtd-theme==3.0.2 ; python_version >= "3.9" -sphinx==7.4.7 ; python_version >= "3.9" -sphinxcontrib-applehelp==2.0.0 ; python_version >= "3.9" -sphinxcontrib-devhelp==2.0.0 ; python_version >= "3.9" -sphinxcontrib-htmlhelp==2.1.0 ; python_version >= "3.9" -sphinxcontrib-jquery==4.1 ; python_version >= "3.9" -sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.9" -sphinxcontrib-qthelp==2.0.0 ; python_version >= "3.9" -sphinxcontrib-serializinghtml==2.0.0 ; python_version >= "3.9" -tomli==2.2.1 ; python_version >= "3.9" -typing-extensions==4.13.1 ; python_version >= "3.9" -urllib3==2.3.0 ; python_version >= "3.9" -zipp==3.21.0 ; python_version >= "3.9" and python_version < "3.10" +alabaster==1.0.0 ; python_version >= "3.11" +babel==2.18.0 ; python_version >= "3.11" +certifi==2026.7.22 ; python_version >= "3.11" +charset-normalizer==3.5.0 ; python_version >= "3.11" +colorama==0.4.6 ; python_version >= "3.11" and sys_platform == "win32" +docutils==0.22.4 ; python_version >= "3.11" +dom-toml==2.3.0 ; python_version >= "3.11" +domdf-python-tools==3.10.0 ; python_version >= "3.11" +idna==3.18 ; python_version >= "3.11" +imagesize==1.5.0 ; python_version >= "3.15" +imagesize==2.0.0 ; python_version >= "3.11" and python_version < "3.15" +jinja2==3.1.6 ; python_version >= "3.11" +markupsafe==3.0.3 ; python_version >= "3.11" +natsort==8.4.0 ; python_version >= "3.11" +packaging==26.3 ; python_version >= "3.11" +pygments==2.20.0 ; python_version >= "3.11" +requests==2.34.2 ; python_version >= "3.11" +roman-numerals==4.1.0 ; python_version >= "3.11" +snowballstemmer==3.1.1 ; python_version >= "3.11" +sphinx-autodoc-typehints==3.13.2 ; python_version >= "3.15" +sphinx-autodoc-typehints==3.6.1 ; python_version >= "3.11" and python_version < "3.15" +sphinx-pyproject==0.3.0 ; python_version >= "3.11" +sphinx-rtd-theme==3.1.0 ; python_version >= "3.11" +sphinx==9.0.4 ; python_version >= "3.11" and python_version < "3.15" +sphinx==9.1.0 ; python_version >= "3.15" +sphinxcontrib-applehelp==2.0.0 ; python_version >= "3.11" +sphinxcontrib-devhelp==2.0.0 ; python_version >= "3.11" +sphinxcontrib-htmlhelp==2.1.0 ; python_version >= "3.11" +sphinxcontrib-jquery==4.1 ; python_version >= "3.11" +sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.11" +sphinxcontrib-qthelp==2.0.0 ; python_version >= "3.11" +sphinxcontrib-serializinghtml==2.0.0 ; python_version >= "3.11" +typing-extensions==4.16.0 ; python_version >= "3.11" +urllib3==2.7.0 ; python_version >= "3.11" diff --git a/examples/abc/abc.py b/examples/abc/abc.py index 27b7290..13208fc 100755 --- a/examples/abc/abc.py +++ b/examples/abc/abc.py @@ -23,6 +23,7 @@ def solve(): c = solution["c"] value = (a * 100 + b * 10 + c) / (a + b + c) if value < minvalue: + minvalue = value minsolution = solution return minvalue, minsolution diff --git a/examples/wordmath/seisseisdoze.py b/examples/wordmath/seisseisdoze.py index 4e37a2b..bc2047f 100755 --- a/examples/wordmath/seisseisdoze.py +++ b/examples/wordmath/seisseisdoze.py @@ -34,7 +34,9 @@ def main(): solutions = solve() print("SEIS+SEIS=DOZE") for s in solutions: - print("%(s)d%(e)d%(i)d%(s)s+%(s)d%(e)d%(i)d%(s)d=" "%(d)d%(o)d%(z)d%(e)d") % s + seis = "%(s)d%(e)d%(i)d%(s)d" % s + doze = "%(d)d%(o)d%(z)d%(e)d" % s + print(f"{seis}+{seis}={doze}") if __name__ == "__main__": diff --git a/noxfile.py b/noxfile.py index 6faa52c..b2cda3c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -5,19 +5,18 @@ Be aware that the general setup of tests is left to pyproject.toml. """ +from pathlib import Path + import nox from nox import Session, session -from pathlib import Path # from nox_poetry import Session, session # nox_poetry is a better option, but <=1.0.3 has a bug with filename-URLs python_versions_to_test = [ - "3.9", - "3.10", "3.11", "3.12", "3.13", - # "3.14" # 3.14 has not yet been officially released + "3.14" ] nox.options.stop_on_first_error = True nox.options.error_on_missing_interpreters = True diff --git a/pyproject.toml b/pyproject.toml index ca30069..8bf3573 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,15 +1,15 @@ [build-system] -requires = ["poetry-core>=2.0.1", "setuptools>=75.8.0", "Cython>=3.0.12"] +requires = ["poetry-core>=2.4.1", "setuptools>=84.0.0", "Cython>=3.2.9"] build-backend = "poetry.core.masonry.api" [project] name = "python-constraint2" # when set back to "python-constraint", don't forget to remove '2' in other places (e.g. README) description = "python-constraint is a module for efficiently solving CSPs (Constraint Solving Problems) over finite domains." -version = "2.3.0" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 +version = "2.7.0" # adhere to PEP440 versioning: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#id55 authors = [ - {name = "Gustavo Niemeyer", email = "gustavo@niemeyer.net"}, - {name = "Sébastien Celles", email = "s.celles@gmail.com"}, {name = "Floris-Jan Willemsen", email = "fjwillemsen97@gmail.com"}, + {name = "Sébastien Celles", email = "s.celles@gmail.com"}, + {name = "Gustavo Niemeyer", email = "gustavo@niemeyer.net"}, ] license = "BSD-2-Clause" readme = "README.rst" @@ -33,15 +33,14 @@ classifiers = [ "Programming Language :: Cython", "Topic :: Scientific/Engineering", "Topic :: Software Development", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] # ATTENTION: if anything is changed here, run `poetry update` -requires-python = ">= 3.9" # when changing the Python versions, also change the test versions in the Noxfile and GitHub Actions +requires-python = ">= 3.11" # when changing the Python versions, also change the test versions in the Noxfile and GitHub Actions [project.urls] Homepage = "http://python-constraint.github.io/python-constraint/" @@ -65,25 +64,26 @@ script = "cythonize_build.py" # ATTENTION: if anything is changed here, run `poetry update` and `poetry export --with docs --without-hashes --format=requirements.txt > docs/requirements.txt` [tool.poetry.group.docs] optional = true +[tool.poetry.requires-plugins] +poetry-plugin-export = ">=1.10" [tool.poetry.group.docs.dependencies] -sphinx = "^7.4.7" # can be updated to >=8.*.* when Python 3.9 is dropped -sphinx-autodoc-typehints = "^2.3.0" # can be updated to >=3.*.* when Python 3.9 is dropped +sphinx = ">=8.0.0" # can be updated to >=9.*.* when Python 3.12 is dropped +sphinx-autodoc-typehints = ">=3.0.0" sphinx_rtd_theme = "^3.0.2" sphinx-pyproject = "^0.3.0" # ATTENTION: if anything is changed here, run `poetry update` [tool.poetry.group.dev.dependencies] -Cython = "^3.0.12" +Cython = "^3.2.9" [tool.poetry.group.test] optional = true [tool.poetry.group.test.dependencies] -pytest = "^8.3.3" -pytest-benchmark = "^5.1.0" -pytest-cov = "^6.0.0" -nox = "^2025.2.9" -ruff = "^0.9.6" +pytest = "^9.1.1" +pytest-benchmark = "^5.2.3" +pytest-cov = "^7.1.0" +nox = "^2026.8.10" +ruff = "^0.16.3" pep440 = "^0.1.2" -tomli = "^2.2.1" # can be replaced by built-in [tomllib](https://docs.python.org/3.11/library/tomllib.html) from Python 3.11 # development dependencies are unused for now, as this is already covered by test and docs # # ATTENTION: if anything is changed here, run `poetry update` @@ -107,7 +107,7 @@ select = [ convention = "google" [tool.pytest.ini_options] -minversion = "8.3" +minversion = "9.1.1" pythonpath = [ "constraint", ] # necessary to get coverage reports without installing with `-e` diff --git a/tests/test_constraint.py b/tests/test_constraint.py index 6785e3a..675e03c 100644 --- a/tests/test_constraint.py +++ b/tests/test_constraint.py @@ -17,8 +17,8 @@ def test_abc(): solutions = abc.solve() minvalue, minsolution = solutions - assert minvalue == 37 - assert minsolution == {"a": 1, "c": 2, "b": 1} + assert minvalue == 10.473684210526315 + assert minsolution == {'a': 1, 'b': 9, 'c': 9} def test_coins(): @@ -125,3 +125,21 @@ def test_multipliers(): solutions = problem.getSolutions() for solution in solutions: assert solution in possible_solutions + +def test_pruning_constraint(): + """Test that the VariableExactSumConstraint prunes the domain correctly.""" + from constraint import VariableExactSumConstraint + + problem = constraint.Problem() + problem.addVariable("a", [1, 2, -1, 3]) + problem.addVariable("b", [1, 2, -1, 3]) + problem.addVariable("c", [3]) + problem.addConstraint(VariableExactSumConstraint("c", ["a", "b"])) + + possible_solutions = [{"a": 2, "b": 1, "c": 3}, {"a": 1, "b": 2, "c": 3}] + + # get the solutions + solutions = problem.getSolutions() + assert len(solutions) == len(possible_solutions) + for solution in solutions: + assert solution in possible_solutions diff --git a/tests/test_doctests.py b/tests/test_doctests.py index 6e29711..17a120f 100644 --- a/tests/test_doctests.py +++ b/tests/test_doctests.py @@ -4,7 +4,62 @@ import constraint.constraints as constraints import constraint.solvers as solvers +import unittest +import re +import textwrap + assert doctest.testmod(problem)[0] == 0 assert doctest.testmod(domain)[0] == 0 assert doctest.testmod(constraints, extraglobs={'Problem': problem.Problem})[0] == 0 assert doctest.testmod(solvers, extraglobs={'Problem': problem.Problem})[0] == 0 + +def extract_python_code_blocks(path): + with open(path, encoding="utf-8") as f: + content = f.read() + + # Matches '.. code-block:: python' followed by any amount of blank space, + # then captures all subsequent lines that are indented by 4+ spaces + pattern = re.compile( + r""" + ^[ \t]*\.\. \s*code-block::\s*python # The directive + (?:\r?\n[ \t]*)+ # One or more blank lines (maybe just newline) + ( + (?: + (^[ \t]{4,}.*(?:\r?\n|$)) # Lines indented ≥4 spaces + | + (^\s*$) # Or completely blank lines + )+ + ) + """, + re.MULTILINE | re.VERBOSE + ) + + matches = pattern.findall(content) + + # # Dedent each block (remove 4-space indent) + # blocks = [textwrap.dedent(block) for block in matches] + + # Each match is a tuple due to multiple capture groups — flatten and dedent + blocks = [] + for match in matches: + block_lines = match[0] + blocks.append(textwrap.dedent(block_lines)) + + return "\n\n".join(blocks) + +class TestReadmeDoctests(unittest.TestCase): + def test_readme_code_blocks(self): + code = extract_python_code_blocks("README.rst") + parser = doctest.DocTestParser() + globs = {} + test = parser.get_doctest( + code, + globs=globs, + name="README.rst", + filename="README.rst", + lineno=0 + ) + runner = doctest.DocTestRunner(optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS) + runner.run(test) + failures, _ = runner.summarize() + self.assertEqual(failures, 0) diff --git a/tests/test_parser.py b/tests/test_parser.py index 2d4117a..6a39d2b 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -1,22 +1,24 @@ from constraint import ( - compile_to_constraints, - parse_restrictions, - Constraint, - FunctionConstraint, - CompilableFunctionConstraint, - ExactSumConstraint, + compile_to_constraints, + parse_restrictions, + Constraint, + FunctionConstraint, + CompilableFunctionConstraint, + ExactSumConstraint, MinSumConstraint, MaxSumConstraint, - ExactProdConstraint, - MinProdConstraint, - MaxProdConstraint, - VariableExactSumConstraint, - VariableExactProdConstraint, - VariableMinProdConstraint, - VariableMaxProdConstraint, + ExactProdConstraint, + MinProdConstraint, + MaxProdConstraint, + VariableExactSumConstraint, + VariableExactProdConstraint, + VariableMinProdConstraint, + VariableMaxProdConstraint, ) +from constraint.parser import extract_operators, is_or_evals_to_number from collections.abc import Iterable + def test_parse_restrictions(): domains = {"x": [50, 100], "y": [0, 1]} constraints = ["x != 320", "y == 0 or x % 32 != 0", "50 <= x * y < 100"] @@ -51,41 +53,44 @@ def test_parse_restrictions(): assert isinstance(parsed_constraint, MinProdConstraint) assert 30 < parsed_constraint._minprod < 31 + def test_compile_to_constraints(): domains = {"x": [50, 100], "y": [0, 1]} constraints = [ - "x != 320", # FunctionConstraint - "y == 0 or x % 32 != 0",# FunctionConstraint - "x == 100", # ExactSumConstraint - "100 == x + y", # ExactSumConstraint # TODO why is this parsed to a FunctionConstraint? - "x == 100+y", # VariableExactSumConstraint - "x == x+y", # VariableExactSumConstraint - "51 <= x+y", # MinSumConstraint - "50 < x+y", # MinSumConstraint - "100-y >= x", # MaxSumConstraint - "100 == x-y", # VariableExactSumConstraint - "x / y == 100", # VariableExactProdConstraint - "x / y == x", # VariableExactProdConstraint - "x / y <= x", # VariableMinProdConstraint - "x / y >= x", # VariableMaxProdConstraint - "50 <= x * y < 100", # becomes splitted MinProdConstraint and MaxProdConstraint + "x != 320", # FunctionConstraint + "y == 0 or x % 32 != 0", # FunctionConstraint + "x == 100", # ExactSumConstraint + "100 == x + y", # ExactSumConstraint + "x + y >= -1", # MinSumConstraint + "x == 100+y", # FunctionConstraint + "x == x+y", # VariableExactSumConstraint + "51 <= x+y", # MinSumConstraint + "50 < x+y", # MinSumConstraint + "100-y >= x", # MaxSumConstraint + "100 == x-y", # FunctionConstraint + "x / y == 100", # FunctionConstraint + "x / y == x", # VariableExactProdConstraint + "x / y <= x", # VariableMinProdConstraint + "x / y >= x", # VariableMaxProdConstraint + "50 <= x * y < 100", # becomes splitted MinProdConstraint and MaxProdConstraint ] expected_constraint_types = [ - FunctionConstraint, - FunctionConstraint, + FunctionConstraint, + FunctionConstraint, ExactSumConstraint, ExactSumConstraint, - VariableExactSumConstraint, + MinSumConstraint, + FunctionConstraint, # TODO should be VariableExactSumConstraint after Roadmap point 1 is implemented VariableExactSumConstraint, MinSumConstraint, MinSumConstraint, - MaxSumConstraint, # with rewriting "100-y >= x" becomes "100 >= x+y" - VariableExactSumConstraint, # with rewriting "100 == x-y" becomes "100+y == x" - VariableExactProdConstraint, # with rewriting "x / y == 100" becomes "x==100 * y" + MaxSumConstraint, # with rewriting "100-y >= x" becomes "100 >= x+y" + FunctionConstraint, # TODO should be VariableExactSumConstraint after Roadmap point 1 is implemented # with rewriting "100 == x-y" becomes "100+y == x" + FunctionConstraint, # TODO should be VariableExactSumConstraint after Roadmap point 1 is implemented # with rewriting "x / y == 100" becomes "x==100 * y" VariableExactProdConstraint, VariableMinProdConstraint, VariableMaxProdConstraint, - MinProdConstraint, + MinProdConstraint, MaxProdConstraint, ] @@ -102,22 +107,21 @@ def test_compile_to_constraints(): # check whether the expected types match (may have to be adjusted to be order independent in future) for i, (r, _, cons) in enumerate(compiled): expected = expected_constraint_types[i] - assert isinstance(r, expected), f"Expected {expected} but got {type(r)} for constraint {constraints[i]}" # the constraint lookup is correct until there are split restrictions + assert isinstance( + r, expected + ), f"Expected {expected} but got {type(r)} for constraint {constraints[i]}" # the constraint lookup is correct until there are split restrictions if callable(expected): assert callable(r) + def test_compile_to_constraints_picklable(): domains = {"x": [50, 100], "y": [0, 1]} - constraints = [ - "x != 320", - "y == 0 or x % 32 != 0", - "50 <= x * y < 100" - ] + constraints = ["x != 320", "y == 0 or x % 32 != 0", "50 <= x * y < 100"] expected_constraint_types = [ - CompilableFunctionConstraint, - CompilableFunctionConstraint, - MinProdConstraint, - MaxProdConstraint + CompilableFunctionConstraint, + CompilableFunctionConstraint, + MinProdConstraint, + MaxProdConstraint, ] compiled = compile_to_constraints(constraints, domains, picklable=True) @@ -137,3 +141,53 @@ def test_compile_to_constraints_picklable(): assert callable(r) else: assert isinstance(r, expected) + + +def test_compile_non_numeric(): + domains = {"x": ["a2", "b4", "c6"], "y": [True, False]} + constraints = ["x == 'a'", "y == 'd' or x != 'b'", "'a' <= x + y < 'c'"] + + compiled = compile_to_constraints(constraints, domains, picklable=False) + + assert len(compiled) == 4 + for r, vals, r_str in compiled: + assert isinstance(r, (Constraint, CompilableFunctionConstraint)) + assert isinstance(vals, Iterable) and all(isinstance(v, str) for v in vals) + if isinstance(r, (FunctionConstraint, CompilableFunctionConstraint)): + assert isinstance(r_str, str) + else: + assert r_str is None + + +def test_is_or_evals_to_number(): + # Test cases where the expression evaluates to a number + assert is_or_evals_to_number(" 42 ") == 42 + assert is_or_evals_to_number("-42") == -42 + assert is_or_evals_to_number(" +3.14 ") == 3.14 + assert is_or_evals_to_number("4.16 + 1.84") == 6 + assert is_or_evals_to_number("1 + 2 * 3 / 4") == 2.5 + + # Test cases where the expression does not evaluate to a number + assert is_or_evals_to_number("x+2") is None + assert is_or_evals_to_number("2 + '3'") is None + assert is_or_evals_to_number("x1 + y2") is None + assert is_or_evals_to_number("3 + 2j") is None + + +def test_extract_operators(): + expression_and_solutions = [ + ("-3<=x+y", ["+"]), # should find: + + ("-3 <= x + y", ["+"]), # should find: + + ("x+y>=-1", ["+"]), # should find: + + ("x-y", ["-"]), # should find: - + ("x**2-1", ["**", "-"]), # should find: **, - + ("x+2+-1", ["+", "+"]), # should find: +, + + ("a*b+c/d-e", ["*", "+", "/", "-"]), # should find: *, +, /, - + ("a * b + c / d - e", ["*", "+", "/", "-"]), # should find: *, +, /, - + ("-x**2+3", ["**", "+"]), # should find: **, + + ] + + for expr, solution in expression_and_solutions: + assert ( + extract_operators(expr) == solution + ), f"Failed for expression {expr}: expected {solution}, got {extract_operators(expr)}" diff --git a/tests/test_solvers.py b/tests/test_solvers.py index adc4c31..8177512 100644 --- a/tests/test_solvers.py +++ b/tests/test_solvers.py @@ -1,5 +1,12 @@ import pytest -from constraint import Problem, MinConflictsSolver, BacktrackingSolver, OptimizedBacktrackingSolver, RecursiveBacktrackingSolver, ParallelSolver +from constraint import ( + Problem, + MinConflictsSolver, + BacktrackingSolver, + OptimizedBacktrackingSolver, + RecursiveBacktrackingSolver, + ParallelSolver, +) from constraint import MaxProdConstraint, MinProdConstraint, MinSumConstraint, FunctionConstraint @@ -19,7 +26,12 @@ def test_min_conflicts_solver(): for _ in possible_solutions: solution = problem.getSolution() assert solution in possible_solutions - problem.addConstraint(FunctionConstraint(lambda x, y: (lambda x, y, xs, ys: x != xs or y != ys)(x, y, solution['x'], solution['y']))) + problem.addConstraint( + FunctionConstraint( + lambda x, y: (lambda x, y, xs, ys: x != xs or y != ys)(x, y, solution["x"], solution["y"]) + ) + ) + def test_backtracking_solvers(): # setup the solvers @@ -57,6 +69,7 @@ def validate(solutions_list, solutions_dict, size): for problem in problems: validate(*problem.getSolutionsAsListDict(order=order)) + def test_recursive_backtracking_solver(): problem = Problem(RecursiveBacktrackingSolver()) problem.addVariable("x", [0, 1]) @@ -74,6 +87,7 @@ def test_recursive_backtracking_solver(): assert solution in possible_solutions assert all(sol in possible_solutions for sol in solutions) + def test_parallel_solver(): # setup the solvers problem = Problem(ParallelSolver(process_mode=False)) @@ -94,12 +108,13 @@ def test_parallel_solver(): order = ["x", "y"] # get all solutions - solutions_list, solutions_dict, size = problem.getSolutionsAsListDict(order=order) + solutions_list, _, size = problem.getSolutionsAsListDict(order=order) # validate all solutions assert size == len(true_solutions) assert all(sol in solutions_list for sol in true_solutions) + def test_parallel_solver_process_mode(): # setup the solvers problem = Problem(ParallelSolver(process_mode=True)) @@ -120,7 +135,7 @@ def test_parallel_solver_process_mode(): order = ["x", "y"] # get all solutions - solutions_list, solutions_dict, size = problem.getSolutionsAsListDict(order=order) + solutions_list, _, size = problem.getSolutionsAsListDict(order=order) # validate all solutions assert size == len(true_solutions) @@ -134,12 +149,19 @@ def test_parallel_solver_process_mode(): with pytest.raises(AssertionError): problem.getSolutions() + def test_solvers_consistency(): """Test that the solvers yield consistent results for the same problem.""" - solvers = [None, MinConflictsSolver(), OptimizedBacktrackingSolver(), BacktrackingSolver(), RecursiveBacktrackingSolver()] + solvers = [ + None, + MinConflictsSolver(), + OptimizedBacktrackingSolver(), + BacktrackingSolver(), + RecursiveBacktrackingSolver(), + ] base_solution = None # variables = ['A','B','E','F','G','H','M'] - variables = ['B','E','M'] + variables = ["B", "E", "M"] def create_problem(solver): print(f"Creating problem with solver: {solver}") @@ -166,7 +188,7 @@ def create_problem(solver): assert tuple(solution.values()) in base_solution else: solutions_list, _, size = problem.getSolutionsAsListDict(order=variables) - + # Check that all solutions are valid assert size > 0, f"No solutions found for {solver}" @@ -175,4 +197,52 @@ def create_problem(solver): base_solution = solutions_list else: assert size == len(base_solution) - # assert all(sol in solutions_list for sol in base_solution) \ No newline at end of file + # assert all(sol in solutions_list for sol in base_solution) + + +def test_mixed_type_constraints(): + """Test that mixed type constraints are handled correctly.""" + problem = Problem() + domains = {"x": ["a", "b", "c"], "y": [True, False], "z": [0, 1], "delta": ["a", True, 0.2]} + for var, domain in domains.items(): + problem.addVariable(var, domain) + constraints = ["x != 'a' or y < z", "y or x != 'b'", "delta == 0.2"] + problem.addConstraint(constraints) + solutions, _, _ = problem.getSolutionsAsListDict(order=list(domains.keys())) + + possible_solutions = [ + ("c", False, 1, 0.2), + ("c", False, 0, 0.2), + ("a", False, 1, 0.2), + ("b", True, 0, 0.2), + ("b", True, 1, 0.2), + ("c", True, 0, 0.2), + ("c", True, 1, 0.2), + ] + + assert len(solutions) == len(possible_solutions), "Number of solutions does not match expected" + assert len(set(solutions)) == len(possible_solutions), "Number of unique solutions does not match expected" + for solution in solutions: + assert solution in possible_solutions, f"Unexpected solution: {solution}" + + +def test_negative_values(): + """Test that negative values are handled correctly.""" + problem = Problem() + problem.addVariable("x", [-2, -1, 1]) + problem.addVariable("y", [-2, -1, 0]) + problem.addConstraint("x + y >= -1") + + solutions = problem.getSolutions() + solutions_list, _, size = problem.getSolutionsAsListDict(order=["x", "y"]) + + possible_solutions = [ + {"x": 1, "y": 0}, + {"x": -1, "y": 0}, + {"x": 1, "y": -1}, + {"x": 1, "y": -2}, + ] + true_solutions = [tuple(sol.values()) for sol in possible_solutions] + + assert size == len(true_solutions) + assert all(sol in solutions_list for sol in true_solutions) diff --git a/tests/test_toml_file.py b/tests/test_toml_file.py index 4e4b19b..2483fbc 100644 --- a/tests/test_toml_file.py +++ b/tests/test_toml_file.py @@ -2,13 +2,13 @@ from pathlib import Path -import tomli +import tomllib package_root = Path(".").parent.parent pyproject_toml_path = package_root / "pyproject.toml" assert pyproject_toml_path.exists() with open(pyproject_toml_path, mode="rb") as fp: - pyproject = tomli.load(fp) + pyproject = tomllib.load(fp) project = pyproject["project"] if "project" in pyproject else pyproject["tool"]["poetry"] diff --git a/tests/test_util_benchmark.py b/tests/test_util_benchmark.py index 97f37d9..c326e37 100644 --- a/tests/test_util_benchmark.py +++ b/tests/test_util_benchmark.py @@ -8,6 +8,11 @@ from .benchmarks import dedispersion, microhh, hotspot +# skip the test module if there are no C-extensions available +from constraint import check_if_compiled +if not check_if_compiled(): + pytest.skip("C-extensions not available, skipping benchmark tests.", allow_module_level=True) + # reference times (using A4000 on DAS6) reference_microbenchmark_mean = [0.3784186691045761, 0.4737640768289566, 0.10726054509480794, 0.10744890073935191, 0.10979799057046573, 0.15360217044750848, 0.14483965436617532, 0.054416230569283165, 0.13835338006416956, 0.1371802551050981] # noqa E501 reference_results = { @@ -123,8 +128,8 @@ def stddev(column, mean): def check_benchmark_performance(benchmark_name, mean, std): """Utility function to check whether the performance of a benchmark is within the expected range and print information.""" reference_result = reference_results[benchmark_name] - assert mean - std * 2 <= reference_result * (performance_factor + mean_relative_std * 2) print(f"Benchmark {benchmark_name}: reference: {round(reference_result, 3)}, run: {round(mean, 3)}, expected: {round(reference_result * performance_factor, 3)}") + assert mean - std * 2 <= reference_result * (performance_factor + mean_relative_std * 2) @pytest.mark.skip def run_and_check_benchmark(benchmark, benchmark_name, problem, expected_num_solutions):